How to change SSH port

how-to-change-ssh-port-attachment-347

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

Share This Article