SSH on multiple ports

At some stage you may find that you need to run the ssh daemon on multiple ports, for example so that you can have it accessable on the normal port 22 from the internal network, but obscure it from outside snoopers by running it also on a second port, allowing the normal ssh port (22/tcp) to be blocked from outside.

Here’s how to do it; edit /etc/ssh/sshd_config with your favourite editor, and find the line that says this

Port 22

add another one below it so it looks like this

Port 22
Port 222222

and restart sshd

/etc/init.d/ssh restart

verify that it’s listening

netstat -anp |grep ssh

and you’re done!



One Response to “SSH on multiple ports”

  1. [...] I followed Jonesy’s guide to allow SSHD to run on multiple ports and whoala – it works. [...]

Leave a Reply

You must be logged in to post a comment.