1 – INSTALL OPERATING SYSTEM
Select Install CentOS 7 and press Enter
Press Enter to begin the installation
Select your Language and click Continue
Complete any items marked with the Exclamation icon. Only the Installation Destination should be marked and will be automatic partitioning by default. Click Installation Destination
By default automatic partitioning is selected. Review the automatic partitioning and confirm it suits your needs and click Done. Otherwise, you’ll need to manually complete the partitioning (beyond this tutorial).
CentOS 7 will now begin to install. Click Root Password to set the password while you wait for the installation to finish.
Enter your Root password twice and click Done. CentOS will rate the strength of your password and obviously the stronger the better.
Once the installation completes, click Reboot.
The boot menu will automatically boot CentOS 7
2 – LOGIN AS ROOT
3 – CONFIGURE NETWORK ADAPTER
4 – INSTALL VMWARE TOOLS (Optional)
If this installation of CentOS 7 is a VMWare Guest OS, you may wish to install the VMWare Tools by running the following command:
yum -y install open-vm-tools
5 – INSTALL NANO (Optional)
If you are not a fan of the vi text editor, you may wish to install Nano which has a more natural text editor feel to it by running:
yum -y install nano
6 – INSTALL UPDATES
Install updates by running:
yum -y update
7 – CREATE A SUDOER USER
It’s best practice to not use the root (super-user) user account. Instead, you should always use a regular user account and allow them root privileges by adding them to the sudoers file. You can then run privileged commands by use the sudo or su commands. Let’s first start by creating a user by running the following command (where sigkill is the username):
Next, we want to set the password for our user by running the following command and enter the password twice when prompted:
Here is an example of the output you’ll receive
Now that your user is created, you want to add them to the sudoers file. You can edit the sudoers file with vi by running the following command. (NOTE: If you’re not familiar with vi, take a look at vi cheat sheet)
Near the end of the sudoers file, locate the following lines
## Allow root to run any commands anywhere root ALL=(ALL) ALL
Add the following line directly below the above lines then save and quit (:wq)
sigkill ALL=(ALL) ALL
Here is an example of how it should look
8 – PREVENT REMOTE SSH ACCESS FOR ROOT
By default, SSH is installed and ready to work once you configure a network adapter. Another best practice is to prevent remote SSH access to the root account.
Locate the following line
Modify the above line to the following then save and quit the file
Restart the SSH Service by running the following command
systemctl restart sshd