How to change ssh port in linux ?
I suggest to change the port for security reason. Because every second there are a lot of bruteforcer keep brute force our sshd port, the original port is 22. If you change to another port, then they may skip you and go find for another victim or maybe they need time to find the port.
login as root
# vi /etc/ssh/sshd_config
The original is
[adrotate banner=”1″]
# Port 22
Change to any port that is not using by other services, example
Port 1337
Then write and quit
:wq
[adrotate banner=”2″]
Restart the SSHD service
# server sshd restart
How to change the default port for ssh ?
How To Change Default SSH Port in Ubuntu?
Change ssh port in Linux ?
Change ssh port in CentOS ?
Is the ssh file name distro-dependent? Mine’s missing the d.
/etc/ssh/sshd_config