Check Ssh Port



Check for open ports and verify port forwarding setup on your router. What is Port Checker? Port Checker is a simple and free online tool for checking open ports on your computer/device, often useful in testing port forwarding settings on a router. Sudo semanage port -a -t sshportt -p tcp 2522. Now that you have put the correct firewall settings, let's move on to changing the SSH port. Changing the default SSH port. Usually, the ssh configuration file is located at /etc/ssh/sshdconfig. You'll have to use a terminal-based editor like Vim or Nano or Emacs to edit the file. If you don't have login access to the server, you can find the SSH port using nmap 's 'version scan' feature: nmap -sV -p- The -sV option means 'version scan', and -p- means 'scan all ports'. Check the port that the SSH server runs on. Test if the port that the SSH server listens to is reachable from the client host. $ nc -zv remotehost 2022 Connection to remotehost 2022 port tcp/. succeeded! -v Produce more verbose output.z Only scan for listening daemons, without sending any data to them.

  1. Sftp Port
  2. Check Ssh Port
  3. Check Ssh Port Open
  4. Check Ssh Port
  5. Check Ssh Port Windows

Check for open ports and verify port forwarding setup on your router.

What is Port Checker ?

Port Checker is a simple and free online tool for checking open ports on your computer/device, often useful in testing port forwarding settings on a router. For instance, if you're facing connection issues with a program (email, IM client etc) then it may be possible that the port required by the application is getting blocked by your router's firewall or your ISP. In such cases, this tool might help you in diagnosing any problem with firewall setup. You could also find this useful for security purpose, in case you're not sure whether a particular port is open or closed. If you host and play games like Minecraft, use this checker to make sure the server port(25565) is configured properly for port forwarding, then only your friends will be able to connect to your server.

Check Ssh Port

Most Commonly Used Ports

Port numbers ranges from 1 to 65535, out of which well known ports are pre-defined as convention by IANA.

Check ssh port linux
  • 0-1023 - Well known ports (HTTP, SMTP, DHCP, FTP etc)
  • 1024-49151 - Reserved Ports
  • 49152-65535 - Dynamic/Private Ports

Well known ports

  • 20 & 21 - FTP (File Transfer Protocol)
  • 22 - SSH (Secure Shell)
  • 23 - Telnet, a Remote Login Service
  • 25 - SMTP (Simple Mail Transfer Protocol)
  • 53 - DNS (Domain Name System)
  • 80 - HTTP (Hypertext Transfer Protocol)
  • 110 - POP3 (Post Office Protocol 3)
  • 115 - SFTP (Secure File Transfer Protocol)
  • 123 - NTP (Network Time Protocol)
  • 143 - IMAP (Internet Message Access Protocol)
  • 161 - SNMP (Simple Network Management Protocol
  • 194 - IRC (Internet Relay Chat)
  • 443 - SSL / HTTPS (Hypertext Transfer Protocol Secure)
  • 445 - SMB
  • 465 - SMTPS (Simple Mail Transfer Protocol over SSL)
  • 554 - RTSP (Real Time Stream Control Protocol)
  • 873 - RSYNC (RSYNC File Transfer Services)
  • 993 - IMAPS (Internet Message Access Protocol over SSL)
  • 995 - POP3S (Post Office Protocol 3 over SSL)
  • 3389 - RDP (Remote Desktop Protocol)
  • 5631 - PC Anywhere
  • 3306 - MySQL
  • 5432 - PostgreSQL
  • 5900 - VNC
  • 6379 - Redis
  • 11211 - Memcached
  • 25565- Minecraft

If you're looking for a full list of port numbers check out this wikipedia page. I've listed all the common ports above, feel free to enter any custom port number to check. By default, this site is taking your device's IP address as target ip address (the device through which you're visiting this web page), but you can change the IP input field to check for other IP addresses - remote clients and servers as well. But, please don't misuse this option otherwise, I would have to restrict the IP address to source again (as I had done earlier). Please keep in mind that if you're using a VPN or proxy server then it may not be able to get your device's IP correctly.

Understanding Port Forwarding

Port forwarding or port mapping involves translating the address (or port number to a new destination), accepting the packets and forwarding it (using routing table). It's typically used in connecting remote computers to specific programs running on computer (in a private LAN (Local Area Network)). For example : running a public server (HTTP, port 80) on a computer in a private LAN or granting SSH access to a specific computer in a private LAN etc. Read More on Wikipedia.

Share on : TwitterFacebook

If you've any feedback/suggestion for this website, please let me know.

If you are aware of the SSH basics, you already know that SSH uses port 22 by default.

When you connect to a server via SSH, most of the time you don't provide any port information. And in such cases, your connection goes to the port 22 of the SSH server.

You can change the default port from 22 a port number of your choice using the following steps:

  • Open the /etc/ssh/sshd_config file for editing.
  • Locate the line that has Port 22 (if it is commented out with #, remove the # as well).
  • Change the line to Port 2522 (or any number of your choice between 1024 and 65535).
  • Make sure that the new port is allowed by the firewalls (if you have any).
  • Restart ssh daemon with sudo systemctl restart sshd.
  • From now onwards, you'll have to specify the port to make the ssh connection ssh user@ip_address_of_server -p 2522.

Sftp Port

Let me show you the steps in details and also tell you why you may consider changing the

Why change the default SSH port?

One of the most elementary tricks for securing SSH server is to change the default SSH port number 22.

Why? Because a number of bot scripts try the brute force attacks on the default port 22. Most of these scripts don't always scan for open ports, and they target the default ports for various known services like SSH.

Changing the default SSH port reduces number of such attacks. There are other ways to improve the security of your SSH server. If interested, please follow these actionable tips for improving SSH server security.

Now that you know why you would change the default SSH port, let's see how to do it.

Allow traffic on the new port by changing the firewall settings

If you have a firewall set or custom ipconfig or ifconfig or if you are using selinux, you must allow the new ssh port before making the changes. Otherwise you may lock yourself out without an SSH access.

Now this part depends upon what kind of firewall or routing you are using.

If you are using UFW, you can use the following command to allow port 2522:

If you are using iptables, you should use this command:

On Fedora, CentOS, Red Hat, the firewall is managed by firewalld and you can use this command:

On CentOS and Red Hat, you may also have to change the SELinux rules:

Now that you have put the correct firewall settings, let's move on to changing the SSH port.

Changing the default SSH port

Usually, the ssh configuration file is located at /etc/ssh/sshd_config. You'll have to use a terminal-based editor like Vim or Nano or Emacs to edit the file.

Distributions like Ubuntu have Nano installed by default so you can use it for opening the file in edit mode like this:

As you can see, you'll have to be a sudo user or root to edit the ssh configuration.

Scroll down a bit and you'll see a line with Port 22. If it starts with #, it means the line is commented out. The commented out lines gives you the default settings.

Check Ssh Port

So if you see # Port 22, it means that default port is 22.

Change this line with a port number of your choice. In Linux, port number 0-1023 are usually reserved for various services. It will be good to avoid using anything between 0 and 1023 to avoid conflicts.

You can use any other port number between 1024 and 65535. I am using 2522 in the example. Make sure to remove the # before the Port line.

Save your changes and exit the editor. If you are using Nano, use Ctrl+X to save and exit.

The next step is to restart the ssh service. Most modern system use systemd services so you can use the following command:

Now if you want to access the SSH server, you'll have to specify the port number:

Was it helpful?

I hope you find this tutorial helpful in changing the SSH port. Now that you have changed the port, you'll have to use it all the time you want to connect to the server via SSH and that could be annoying.

This is why I recommend using SSH config file to save the settings for easy and quick access.

Check Ssh Port Open

Become a Member for FREE

Check Ssh Port

Become a member to get the regular Linux newsletter (2-4 times a month) and access member-only contents.

Check Ssh Port Windows

Join the conversation.