OpenSSH uses Secure Shell or SSH protocol, this allows users to connect to a remote system using a client-server architecture. The login session is encrypted and very secure. Configuring OpenSSH on CentOS 7 is fairly easy and only takes a few commands.
To install OpenSSH if it is not already installed use the following commands:
# yum install openssh openssh-server openssh-clients openssl-libs
Once the packages are installed you are ready to connect to the server with SSH if you are using it local you can just connect to the server with any ssh client. If you are planning on connecting to this server remotely from a different location make sure you change the port for an extra added layer of security. To do so you want to Edit the sshd_config file. To edit the file it is always best to make a copy of the default file:
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig
Now you can edit the sshd_config file using your favorite editor; vim or nano by doing the following:
# vim /etc/ssh/sshd_config
In the config you want to change the PORT: from 22 to the Port you want like 2022 or 2222. It is completely up to you. If you do change the port you will need to restart the service to make the change live:
# systemctl restart sshd.service
There are even more security options you can setup like “Key-based Authentication” this will allow you to connect to your server via SSH without using the password of your system user. Instead you will need to use an SSH Key.
If this has helped you please share or like our page