Understanding Default SSH Port

What is Default SSH Port?

The default SSH Port number is 22. SSH is used to enable secure communication between devices over the Internet.

A port is required to connect and start all communications between two devices over the network using SSH.

To enhance security, the default SSH Port can be changed.

Before SSH, telnet with port 23 and FTP with port 21 were being used.

Tatu Ylonen who was already the SSH creator decided to have a free port that could be ideally located between these two frequently used ports.

Requesting a registered privileged port number for his new software, which he called SSH, Ylonen wrote an email to the IANA.

The SSH server still uses port 22 by default to prevent IP, DNS, and routing spoofing, even after all this time.

However, due to security reasons, configurations, compatibility, and more, the default SSH Port can be changed.

How to Change the Default SSH Port?

Due to security reasons, you can change SSH port in Linux and reduce the risk of automated attacks that target port 22.

To do this, you need to change the /etc/ssh/sshd_config file to change your default SSH port number.

Additionally, keeping a copy of your documents on hand is usually a smart move.


For example, if you have changed the port on 5522, you need to mention the port number to establish a connection with the server by running the command below:

ubuntu@ubuntu:~$ ssh username@userIP -p 5522

As a result, it is clear that the procedure is really straightforward and uncomplicated. You just need to run a few commands to get started.

SSh tunnels are powerful tools but they can also transit an enterprise firewall undetected. However, you can use some tools to prevent unauthorized use of SSH tunnels through a corporate firewall.

SSH uses port 22 for communication by default.


The default SSH port number is 22, however, in many situations where you need to communicate important data, it becomes problematic.

An SSH port is a network protocol that securely allows access to a device over an unsecured network, whether you are a user or a system administrator.

Changing the default SSH Port from 22 to your considered port number is possible.

Leave a Reply

Your email address will not be published. Required fields are marked.

Kerim Publish in February 29, 2024 at 7:29 am

Plz vpn server

Steven Publish in May 24, 2023 at 6:30 am

what port ssh is risky?

    Liosa F Publish in May 26, 2023 at 11:24 pm

    Port 22. Port 22 is the default port for SSH connections, and any hacker who wants to get into your SSH server will try to get in through this port first. So, changing the port will give your SSH connection an extra layer of security and stop automatic attacks on the SSH server.

Carol Publish in May 18, 2023 at 5:38 am

Apart from port 22, other ssh ports can be used?

    Ashley Publish in May 18, 2023 at 7:58 pm

    Yes, in addition to port 22, you can also use additional ports for SSH. You must modify particular settings in the sshd_config file to utilize ssh on a port other than 22 on your server. The line must first be uncommented by deleting the hash (#) and replacing 22 with the new port number you want to use. After that, save the modifications and quit the text editor.