How to Change the SSH Server Port Number for Ruachost Servers

This guide explains how to change the SSH port number on a ruachost server for enhanced security or to meet specific third-party requirements.

Important Note:

This procedure is intended for ruachost unmanaged servers or VPS services with root access. Shared hosting environments do not have root privileges and cannot modify the SSH port.


Steps to Change the SSH Port Number

  1. Log in to the server as root
    Use your SSH client to log in to the server with root privileges.

  2. Edit the SSH Configuration File
    Open the SSH configuration file (/etc/ssh/sshd_config) using your preferred text editor. For example:

    nano /etc/ssh/sshd_config
  3. Find the SSH Port Directive
    Locate the line that specifies the current SSH port, typically:

    Port 22

     

  4. Change the Port Number
    Modify the port number to your desired value. For example, if you want to use port 7822:

    Port 7822

     

    Ensure the new port number is not in use by any other service and that it complies with your network security policies.

  5. Save and Close the File
    Save your changes and exit the text editor.

  6. Restart the SSH Service
    Apply the changes by restarting the SSH service. The command varies depending on your Linux distribution:

    • For AlmaLinux and Fedora:
      service sshd restart
       
    • For Debian and Ubuntu:
      service ssh restart
  7. Test the New SSH Port
    Before logging out of your current SSH session, open a new terminal and attempt to log in using the new port number:

    ssh -p <new_port_number> user@your_server_ip

     

    Important: Do not close your existing session until you have confirmed that the new port works.


By following these steps, you'll successfully change the SSH port number on your Cloudnetvox server. For security purposes, using a non-default SSH port is a good practice, but make sure to update your firewall rules accordingly.

Var dette svaret til hjelp? 0 brukere syntes dette svaret var til hjelp (0 Stemmer)

Powered by WHMCompleteSolution