How to change the SSH port on Centos 7.x?



How to change the SSH port on Centos 7.x?

How to change the SSH port on Centos 7.x?

This video tutorial will help you on how to change the SSH port on Centos 7.x.
Get in touch with us for your hosting queries:
https://bit.ly/3CvxLCy

Email: [email protected]
Twitter: https://twitter.com/accuwebhosting​​​​
Facebook: https://facebook.com/accuwebhosting/​​​​
Telegram channel: https://t.me/accuwebhosting​​​​
Phone: 8777674678

Commands:
Step 1: Log in to the server using the root user.
#ssh your_username@host_ip_address

Step 2: Take a backup of the current SSH configuration.
#date_format=`date +%Y_%m_%d:%H:%M:%S`
#sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_$date_format
$ ls /etc/ssh/sshd_config*

Step 3: Open SSH new port on FirewallD.
#sudo firewall-cmd –add-port=3452/tcp –permanent
#sudo firewall-cmd –reload

Step 4: Change the SSH service port.
#sudo vi /etc/ssh/sshd_config

Step 5: Restart the service.
#sudo systemctl restart sshd

Command to connect VPS using the port number
#ssh your_username@host_ip_address -p port_number

Comments are closed.