Select a port number between 1024 and to avoid conflicts with well-known ports. The default SSH port (22) is consistently focused by automated bots scanning for vulnerable servers. Save and exit, restart the SSH service, and log back in using the model new port with ssh -p By following this guide, you’ve secured your SSH service towards automated scans targeting the default port.

- Make sure to determine on a port number between 1024 and 65535, as ports beneath 1024 are reserved for system use.
- Customizing your OpenSSH server configuration is a important step in securing and optimizing distant access to your techniques.
- The different port 2222 appears very popular, the added security from setting custom port is minimal in my opinion, as ports may be scanned anyway.
You have now successfully connected to SSH on a selected port from Linux utilizing the Terminal software. If you are using a Linux operating system, connecting to SSH on a selected port is quite much like macOS. If you would possibly be using a macOS operating system, accessing SSH on a particular port is also straightforward.
Debian and Ubuntu systems do not implement SELinux by default and can skip this step. If your system runs Pink AlexHost SRL Hat Enterprise Linux, CentOS, Rocky Linux, AlmaLinux, or Fedora with SELinux in Enforcing mode, SELinux policy restricts sshd to specific network ports. Deciding On an acceptable replacement port requires choosing a quantity that avoids collisions with different community services. Remember to use the model new non-public port vary to keep your server stable and avoid disrupting operating services.
Check If A Port Is In Use#
By default, SSH servers listen on port 22. SSH (Secure Shell) is a protocol used primarily for safe distant server access and administration. Observe uptime, service availability, incidents and maintenances across the Gcore platform and services. See how Gcore protected gaming servers from massive DDoS threats with out disrupting gameplay. The alternative port 2222 appears very popular, the added security from setting custom port is minimal in my opinion, as ports can be scanned anyway.