Top 5 things to do after Linux Installation – RHEL/CentOS 7 Configuration
2. Hostname – hostname and proper FQDN configuration
Suggestable Read: How to configure hostname in Red Hat / CentOS 7.
To check the hostname details below command will give an output of the hostname and complete system architecture details.
|[[email protected] ~]# hostnamectl status|
Configuring Static Hostname:
|[[email protected] ~]# hostnamectl set-hostname “your new hostname” –static|
Add the fully Qualified hostname into the /etc/hostname and /etc/hosts files.
|[[email protected] ~]# vim /etc/hostname|
|[[email protected] ~]# vim /etc/hosts|
Verifying DNS name to resolve with the local domain. Add name server(DNS) details in resolve.conf file.
|[[email protected] ~]# cat /etc/resolv.conf|
# Generated by NetworkManager
nameserver 192.168.1.1 =======================================================================
3. SELinux – Secure Linux configuration
First check the sestatus, by default it will in enable state. most of the time will set SELinux as disable or permissive mode. In my case, I’m disabling the SELinux to allow incoming and outgoing connections without any restrictions.
This command is used to check the selinux status. if it is in enforcing mode, you can disable temporarily by using setenforce 0 commands or you disable it permanently from the /etc/selinux/config configuration file.
|[[email protected] ~]# sestatus|
Selinux configuration file and set the correct mode which is suitable for your environment.
|[[email protected] ~]# vim /etc/selinux/config|
Note: – Reboot is required when SElinux configuration changes. until reboot changes will be temporaty.
Step 4: IPTABLES : iptables is a user-space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Different kernel modules and programs are currently used for different protocols
To list out the enabled iptables rules with below command. If it is enabled with long list following next command will help you to flush those firewall rules.
|[[email protected] ~]# iptables -L|
Flush (Deleting) the iptables rules.
|[[email protected] ~]# iptables -F|
Then Stop/Disable the Firewall Daemon service with the help of below commands.
|[[email protected] ~]# systemctl stop firewalld|
|[[email protected] ~]# systemctl status firewalld.service|
5. YUM(Yellow Dog Updater, Modifier) Repository Configuration and verification
Also Read: Local Yum Repository Server Configuration
Go to the yum repository configuration and enable the centosplus repo setup to auto enable all the above links.
simply put this parameter Enable =1
|[[email protected] ~]# vim /etc/yum.repos.d/CentOS-Base.repo|
|[[email protected] ~]#yum clean all|
|[[email protected] ~]#yum repolist|
Finally reboot the server, then deploy the services what you need. This is all about RHEL/CentOS 7 Configuration.