Our community of experts have been thoroughly vetted for their expertise and industry experience.
Browse All Articles > How to Configure SSh to authenticate to different Port and Allow acces through the Firewall Ubuntu
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation.
From the Ubuntu virtual machine open the Terminal:
Under #What ports, IPs and protocols we listen for
Since I configure this already I am providing the screenshot of the sshd_config file by using the grep command -A1 tells grep to include 1 line after the match. -B1 includes lines before the match.
****I am using this port as an example.*****
In order for changes to take, you have to restart the ssh service.
To Action From
-- ---------- --------
56628 ALLOW 10.0.11.192
Here is my example of this status of the firewall and the allowed ssh rule and Port.
Now find the IP address of the Ubuntu workstation from the terminal. Type
We are going to need to install Putty on the Windows workstation
Here the link. Once Putty is installed you need the IP address that you obtained from the Ubuntu virtual environment. Place it in the HostName and the Port 56628 in Port location. Make sure SSH is selected and click open. Once a connection is established you will be prompted for Username then your password. Now you have made a successful SSH connection using a different port number then 22.