Change SSH Port on Ubuntu Server

Configuring Ubuntu, F.A.Q.'s, How To's, P.C. Linux, Ubuntu, Ubuntu Server

First before you make any changes if you are doing this remotely after you drop your connection and reconnect you will need to use the new port. If you broke something you will need direct console access, I do not recommend doing this remotely unless you are sure this will work for you!

First open up the ssh config file:

nano /etc/ssh/sshd_config

Now locate the lines that have the following:

...
# What ports, IPs and protocols we listen for
Port 22
...

Change it to reflect your favorite port:

# What ports, IPs and protocols we listen for
Port 1337

Now reboot:

reboot

DONE!

No Comments

Leave a Reply

You must be logged in to post a comment.