After fresh installation of CentOS 7, the following are list of things that you may consider doing to get your server ready for any kind of setup. The list is not comprehensive but it’s enough for new Server. We had talked about:
Top things to do after Fresh Installation of Fedora 23
Top Ten Must Do Things After Installing Kali Linux
1. If you installed the OS as root user and didn’t add any standard user account, do it here.
useradd "username" passwd "username"
Give user a privilege to switch to root as administator.
usermod -G wheel "username" vim /etc/pam.d/su
Uncomment line 6 to look like one shown below.
auth required pam_wheel.so use_uid
Transfer root privilege to a user you added, here the username is “username”.
# add to the end of the file the user added to use use all root privileges.
username ALL=(ALL) ALL
2. Disable SELinux (Security-Enhanced Linux) if you don’t need it.
sed -i 's/(^SELINUX=).*/SELINUX=disabled/' /etc/selinux/config
If you reboot your system and type
You should get the output saying selinux have been disabled. See below
SELinux status: disabled
3. If you don’t need a firewall, disable it using commands below.
systemctl stop firewalld systemctl disable firewalld rolekit
4. Configure hostname for the server.
hostnamectl set-hostname "yourhostname"
5. Configure timezone for the server with the command below. Replace Africa/Nairobi with your correct timezone.
timedatectl list-timezones timedatectl set-timezone Africa/Nairobi
6. Configure Ethernet network connection to give it ip address and other network parameters.
First, you need to check the name of the Ethernet device before modifying its configurations. Use command below
My Ethernet adapter is eno1.
I will configure my eno1 with ip address 192.168.1.4, subnet mask 255.255.255.0, gateway 192.168.1.1, DNS server 192.168.1.1 . The method of configuration will be set to manual.
nmcli connection modify eno1 ipv4.addresses 192.168.1.4/24 nmcli connection modify eno1 ipv4.gateway 192.168.1.1 nmcli connection modify eno1 ipv4.dns 192.168.1.1 nmcli connection modify eno1 ipv4.manual method
Make changes take effect by restarting the interface.
nmcli connection down eno1 nmcli connection up eno1
Confirm that the changes have been committed:
ip addr show
7. If your network doesn’t use ipv6, you can disable it by opening grub configuration file and adding ipv6.disable=1 to GRUB_CMDLINE_LINUX on Line 6.
Your results should look like one shown below.
GRUB_CMDLINE_LINUX=" ipv6.disable=1 rd.lvm.lv=fedora/root rd.lvm.lv=fedora/s wap rhgb quiet"
Update grub configuration
grub2-mkconfig -o /boot/grub2/grub.cfg
8. Now do system update and upgrade.
yum -y update
7. Install tab completion package
yum install bash-completion
8. Add additional essential repositories.
9. Configure vim
a) Set global alias for vim by editing file /etc/profile.
b) Add the line below to the end
c) Apply changes
d) To configure vim for your user account only, save configurations to ~/.vimrc file but for all user account write to /etc/vimrc.
Then add the following lines
9. If you would like to do Virtualization with KVM, do thw following.
10. Install Apache,php, MariaDB and phpmyadmin.
Set up MariaDB password.
Say yes to set root password,remove anonymous users,disallow root login remotely and remove test database.Then reload privilege tables.
Try logging in with your password.
mysql -u root -p
yum -y install phpMyAdmin php-mysql php-mcrypt
11. Install docker
yum -y install docker
12. Set keymap and locale settings.
localectl set-locale LANG=en_US.UTF-8 localectl
localectl set-keymap us
13 Changing Run-Level:
You can change runlevel by linking to /etc/systemd/system/default.target. You can change runlevels between graphical and multi-user using the following.
systemctl set-default graphical.target reboot
To change to runlevel 3 type:
systemctl set-default multi-user.target reboot