Before beginning#
These are the steps to do on the SSH server.
Be sure to do all the steps before exiting SSH connection if you are connected via SSH.
This config was tested for default CentOS 7 iso.
Change the SSH port#
You can start by backup your current SSH configuration :
You can now open the default SSH configuration file :
Un-comment the Port
line and change the value.
Save the file.
By default, SELinux only allow port 22 for SSH. So you need to enable the new port through SELinux :
You can now restart the SSH server :
Verify that SSH is now running on the new port :
You may want to try the SSH connexion with another user before exiting your current SSH session.
You can now use the new port number :
That's it !