How to allow more than one port for SSH in Linux

Normally we’re using port number 22 for SSH. If you want to change default port number from 22 to other port number or add another ports for SSH, you can edit in sshd_config under /etc/ssh. To edit sshd_config file, type the following in Terminal or SSH client (SSH Secure Shell or Putty).

nano /etc/ssh/sshd_config

or

vi /etc/ssh/sshd_config

Find “Port“. And change 22 to any port number you want or add another port numbers below.

SSH Port