How do I configure ufw to allow ssh on another port?

I'm having some difficulties at the moment with my Ubuntu SSH server. The only title I could come up with summarizing my situation was too long so here is my problem:

I recently discovered the firewall "ufw" command on Ubuntu, now I am trying to configure so that when I use putty to connection via SSH to my Ubuntu OS, that I could only use a very specific port number and not the default port "22".

For some reason, I am being refused access on my newly chosen port. Since I'm still new to Ubuntu and networking, I don't quite understand what's wrong, any advice?

0

1 Answer

I guess you haven't allowed the SSH port in your ufw configuration. In the case where you have not done this, the port where SSH is running is blocked by the firewall. I guess you can't have remote access to your server...

If you have (physical) access to your server you can open the SSH port using following command:

sudo ufw allow <port number>/tcp 
4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like