Initial Configuration of CentOS7

Please refer to the steps below on how to perform initial configuration of fresh installation of CentOS7

#initial Steps on CentOS7
yum check-update

#verify CentOS installed 
cat /etc/centos-release
    CentOS Linux release 7.4.1708 (Core)

#verify kernal installed 
uname -a

#Statis IP Address
vi /etc/sysconfig/network-scripts/ifcfg-ens192
    TYPE="Ethernet"
    PROXY_METHOD="none"
    BROWSER_ONLY="no"
    BOOTPROTO="none"
    DEFROUTE="yes"

    IPADDR="192.168.1.251"
    NETMASK="255.255.255.0"
    GATEWAY="192.168.1.1"
    DNS1="8.8.8.8"
    DNS2="8.8.4.4"

    IPV4_FAILURE_FATAL="no"
    IPV6INIT="yes"
    IPV6_AUTOCONF="yes"
    IPV6_DEFROUTE="yes"
    IPV6_FAILURE_FATAL="no"
    IPV6_ADDR_GEN_MODE="stable-privacy"
    NAME="ens192"
    UUID="ebc43f37-db61-40ae-a429-20ab74c63741"
    DEVICE="ens192"
    ONBOOT="yes"

#Change hostname
hostnamectl set-hostname centos7
#Reboot Server to apply the changes
reboot

#Check Latest Updates & upgrade 
yum check-upgrade
yum upgrade 

#Install Open-vm-tools
yum install open-vm-tools

#Add Extra Package for Enterprise Linux (EPEL) Repository.
yum install epel-release

#Clean up yum cache 
yum clean all

#Add User 
adduser kwyong
passwd kwyong
#wheel group have sudo privileges (by default)
usermod -aG wheel kwyong


ssh-copy-id [email protected]
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
X11 forwarding request failed on channel 0

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

#Disable SSH Password login 
vi /etc/ssh/sshd_config
   PasswordAuthentication no
systemctl restart sshd

#Verify SELinux is running and enforcing 
getenforce
#Firewalld is running
systemctl status firewalld

Install webmin for Web based GUI Management

#Install webmin
vi /etc/yum.repos.d/webmin.repo

    [Webmin]
    name=Webmin Distribution Neutral
    #baseurl=http://download.webmin.com/download/yum
    mirrorlist=http://download.webmin.com/download/yum/mirrorlist
    enabled=1

yum install wget
wget http://www.webmin.com/jcameron-key.asc
rpm --import jcameron-key.asc

yum install webmin

Allow incoming TCP 10000 in firewalld, and you should be able to access webmin via https://IP-ADDRESS:10000 now

[root@centos7 ~]# firewall-cmd --zone=public --add-port=10000/tcp --permanent
success
[root@centos7 ~]# firewall-cmd --reload
success

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top