Tue. Jan 21st, 2020



SSH Server (OpenSSH) – Change listening port

openssh-serverMany reasons for changing the listening port of your SSH server. You only have 1 public IP, and a bunch of virtual machines on a virtual network, avoiding the script kiddie hammering on port 22, and many more.

Changing it is done like this:
vim /etc/ssh/sshd_config

On or around line 5 there is:
Port 22
Change this to what ever port you like… Almost. A lot of the ports, specially on the lower end of the scale, is in use or reserved. Get an overview hereĀ http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

Remember to restart SSH:
service ssh restart

Happy sshing!