To change the port for the SSH server, follow these steps:

  1. Log in to the server as root using SSH.
  2. Open the /etc/ssh/sshd_config file in your preferred text editor (nano, vi, etc.).
  3. Locate the following line:
    Port 7822
    Remember that for security reasons, A2 Hosting uses port 7822 for SSH connections instead of the default port 22.
  4. Change 7822 to the new port number that you want to use.
  5. Save the changes to the /etc/ssh/sshd_config file, and then exit the text editor.
  6. Restart the SSH service using the appropriate command for your Linux distribution:
    • For CentOS and Fedora, type:
      service sshd restart
      
    • For Debian and Ubuntu, type:
      service ssh restart
      
  7. While still logged in as root, in a new terminal window try to log in using the new SSH port number. If the login fails, check your settings. Do not exit your open root session until you are able to log in using the new configuration.
0 0 vote
Article Rating