All articles, Linux server, Web Hosting Tools and Techniques

How to change SSH port

How to change SSH port

By default, the SSH server uses port 22. Open the configuration file of the SSH server with an existing text editor, such as nano, and look for the line: Port 22 or your current port. Save the file and restart SSH with the following command:

Debian / Ubuntu

/etc/init.d/ssh restart

CentOS

/etc/init.d/sshd restart

FreeBSD

/etc/rc.d/sshd restart