Change The Default SSH Port In Linux
These solutions cowl the port quantity, shopper syntax and why a change may not take effect. For firewall checks, use the Linux firewall status information. If the port listens domestically however distant purchasers time out, examine supplier, router or community security rules in addition to the host firewall. The first command checks the local listening socket. If systemctl reviews a failure, use that session or a console to examine the service journal and restore the final working configuration.
- If systemctl reports a failure, use that session or a console to inspect the service journal and restore the final working configuration.
- Choose a port above 1024 that isn’t utilized by the most common privileged companies to reduce conflicts and reduce publicity to assaults.
- SSH, or Secure Shell, is an important protocol for securely accessing and managing distant servers.
- Altering the default SSH port is an efficient safety measure that can reduce your server’s vulnerability to attacks.
Altering the SSH port reduces noise from bots. Use a devoted consumer with sudo entry for safer administration. Most trendy distros ship OpenSSH 9.x, which helps sturdy algorithms and trendy defaults. In this step-by-step information, you’ll learn how to configure SSH on a Linux server properly, from installation to security hardening, using trendy best practices for 2026.

It reduces the variety of bot attacks on the server. Also discover ways to change the SSH server port. After the service restart, the consumer would not have the power to AlexHost SRL connect to the server by way of the old port, Take Away the # image, change the default port from 22 to 5444 and save it,
Changing the SSH port is a straightforward but efficient method to cut back brute-force assault attempts. Firewalld is default on RHEL-based systems. Your system’s firewall blocks incoming traffic by default. Search for the road starting with #Port 22 (the # means it’s commented out by default). SSH makes use of TCP ports, and you’ll want to pick out a port quantity between 1 and 65535. Passionate about learning and adapting fast, he believes small details create big success.