Using Multiple SSH ports
This is not the most obvious functionality, hence I decided to share it as a separate post. It’s quite easy and perfectly acceptable to specify more than one SSH port for your sshd daemon – useful for debugging or added security (when bound to separate IP addresses).
Adding Extra SSH ports
Simply edit the /etc/ssh/sshd_config file and add more port numbers under the existing default port (it’s commented out because 22 is used by default):
Change this:
to this:
IMPORTANT: you must uncomment Port 22, otherwise new ports will be the only SSH ports listened on (so SSH port 22 will stop working).
Now restart ssh:
Confirm each new SSH port
netstat command with grep confirms that all 3 ports are being listened on now:
If we want to, we can even try connecting to a non-standard ssh port like 221 or 222 as per our changes.
Don’t be alarmed about warning:
Hope you enjoy this advice, stay tuned for more!
See Also
This is not the most obvious functionality, hence I decided to share it as a separate post. It’s quite easy and perfectly acceptable to specify more than one SSH port for your sshd daemon – useful for debugging or added security (when bound to separate IP addresses).
Adding Extra SSH ports
Simply edit the /etc/ssh/sshd_config file and add more port numbers under the existing default port (it’s commented out because 22 is used by default):
Change this:
to this:
IMPORTANT: you must uncomment Port 22, otherwise new ports will be the only SSH ports listened on (so SSH port 22 will stop working).
Now restart ssh:
Confirm each new SSH port
netstat command with grep confirms that all 3 ports are being listened on now:
If we want to, we can even try connecting to a non-standard ssh port like 221 or 222 as per our changes.
Don’t be alarmed about warning:
Hope you enjoy this advice, stay tuned for more!