Change SSH server port

You can change the port that your SSH server runs other than the default 22 by specifying the desired port number in your SSH server configuration file.

Set the Port option in /etc/ssh/sshd_config to your desired port as in the following example;

Port 22

You can use any number between 1 to 65535 as long as it's not used by other programs.

Be sure to reboot your SSH server afterwards.

Sign up for Complete Secure Shell Course and many other great courses on Udemy to learn more.


Written by Mohd Shakir Zakaria. Last updated on 2019-02-12