Here I am assuming that we started with the minimal installation of Centos 7.
Let’s install some useful packages
yum install wget vim mc ntp net-tools
Now let’s configure the timezone and start the ntp service
timedatectl list-timezones | grep Athens
timedatectl set-timezone Europe/Athens
systemctl start ntpd.service
systemctl enable ntpd.service
Next we will change ssh default port. Edit ssh config file and uncomment Port putting your desired port number.
vim /etc/ssh/ssh_config
systemctl reload sshd.servive
Now let’s disable SElinux changing config file to SELINUX=disabled
vim /etc/sysconfig/selinux
Finally let’s configure firewall
systemctl status firewalld
Show configuration
firewall-cmd --permanent --list-all
Allow port
firewall-cmd --permanent --add-port=4311/tcp
Allow service
firewall-cmd --get-services firewall-cmd --permanent --add-service=http
Remove service or port
firewall-cmd --permanent --remove-service=http firewall-cmd --permanent --remove-port=4311/tcp
Reload and start at boot
firewall-cmd --reload systemctl enable firewalld