CentOS is a Linux distribution that provides a free and open-source community-supported computing platform, functionally compatible with its upstream source, Red Hat Enterprise Linux.
After installing Centos 8, there are a few things you might want to do to get the most out of the system. These will increase the security and usability of your server and will give you a solid foundation for subsequent actions.
Update the system
Ensure the system and all the packages are up to date:
sudo dnf -y update
sudo dnf -y upgrade
Install epel-release
dnf install -y epel-release
Install common packages
sudo dnf install -y \
vim \
telnet \
htop \
wget \
unzip \
make
Set hostname
sudo hostnamectl set-hostname ${HOSTNAME}
Disable SELinux (Security-Enhanced Linux) if you don’t need it
Single command to do that
sed -i 's/(^SELINUX=).*/SELINUX=permisive/' /etc/selinux/config
For the changes to apply, you will need to apply, you will need to reboot. If you want the changes to apply without rebooting please type the following:
sudo setenforce 0
To get status
getenforce
sestatus
Configure firewall
If you do not want to use firewall, disabl it with this command:
systemctl disable --now firewalld
Configure timezone
Set up the server timezone
Get a list of timezones with this:
timedatectl list-timezones
Set your timezone with this command replacing Asia/Dubai
with your timezone
timedatectl set-timezone Asia/Dubai
Typing this command timedatectl
will display timezone display timezone details
# timedatectl
Local time: Thu 2021-08-05 06:58:44 UTC
Universal time: Thu 2021-08-05 06:58:44 UTC
RTC time: Thu 2021-08-05 06:58:44
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Set up user
Create a new user
sudo useradd user
Set password for the user
sudo passwd user
Add user to wheel
so they can do sudo
sudo usermod -aG wheel user