Table of Contents
Introduction
When you created a new Server. How to step for your Server. In this tutorial, I will configure your new Centos 8. Now, let’s go to Initial Server Setup Centos 8.
Create a Sudo User and Granting Administrative Privileges
useradd devopsroles
passwd devopsroles
usermod -aG wheel devopsroles
su - devopsroles
The output terminal as below
Open a new terminal window
ssh devopsroles@SERVER_IP_ADDRESS
Disable SSH Root Login
We have new account. so, I can secure our server by disabling remote SSH account to the root account.
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_BK
sudo sed -i -e 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config
sudo cat /etc/ssh/sshd_config | grep PermitRootLogin
The output terminal as below
we need to restart the SSH
sudo systemctl reload sshd
Changing the hostname
sudo hostnamectl set-hostname server1.devopsroles.com
Setting Up a Basic Firewall CentOS 8
Firewalld is a firewall management tool for Linux operating systems. you need to make sure that the server firewall allows web access.
sudo firewall-cmd --add-service=http --permanent
sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo systemctl status firewalld
Update CentOS 8 System
sudo yum check-update
sudo yum upgrade -y
sudo yum clean all
Install System Utilities
sudo yum -y install bind-utils net-tools psmisc traceroute tree vim-enhanced wget
Conclusion
At this point, You have Initial Server Setup Centos 8. I hope will this your helpful. Thank you for reading the DevopsRoles page!