{"data":{"external_id":1486,"slug":"how-do-i-change-the-ssh-port","title":"How to Change the SSH Port?","content":"By default, SSH uses port 22. In some cases, it might be a good idea to change your server&#8217;s SSH (Secure Shell) port. We will explain why and show you different ways to change the SSH port on your server.\nWhy?\nChanging the default SSH port (22) can help reduce automated brute force attacks, as many bots target only known ports. Although this is not a complete security measure, it makes it harder for attackers to find the service and can significantly reduce unwanted login attempts. Additional security measures like Fail2Ban or an SSH key authentication system should still be used.\nChange the SSH Port using Vionity\nVionityCP SSH Settings\nOpen the Cloud Manager of the server where you want to change the SSH port.\nClick on VPS Settings.\nOpen the tab named &#8222;SSH&#8220;.\nEnter the desired SSH port in the &#8222;Change SSH Port&#8220; field. Be sure to use a free port above 1024.\nClick &#8222;Save&#8220;.\nThe configuration will be updated in the background, and your SSH server will be restarted.\nImportant: If you are using a software firewall (iptables, ufw, firewalld), you must open the port first. If you forget to do this, you can easily fix it using VNC.\nManually Edit the Configuration\nYou can also manually edit the SSH server configuration. Here&#8217;s how.\nConnect to your Linux server via SSH.\nOpen the file \/etc\/ssh\/sshd_config with an editor like &#8222;nano&#8220;.\nFind the line that contains &#8222;Port&#8220;. If it doesn&#8217;t exist, create it close to the top. Ensure the line doesn&#8217;t start with &#8222;#&#8220;. If it does, remove the &#8222;#&#8220;, otherwise the SSH server will ignore it.\nWrite the number you want to use as the SSH server port after &#8222;Port&#8220;. For example, Port 2222. Choose a port between 1024 and 65565.\nThe \/etc\/ssh\/sshd_config File\nSave the file.\nCheck if the configuration is read successfully using the command &#8222;ssh -T&#8220;. If an error appears, check your configuration.\nRestart the SSH server (service ssh restart), but don&#8217;t close the SSH window yet.\nOpen a new SSH window and test the connection. If something doesn&#8217;t work, you can still use the first open session to fix the issue.\nWhen Should I Not Change the SSH Port?\nIf your server is protected by a DDoS shield and runs a program that requires this protection, you should not change the SSH port. The reason is that the firewall can only reliably identify legitimate SSH traffic on the default SSH port (22). If the port is changed, the firewall might not recognize the SSH traffic correctly, leading to your connection being suddenly dropped and your IP address being blocked for a few minutes.","schema":null,"facts":[],"links":[{"type":"faq","url":"https:\/\/support.prepaid-hoster.de\/faq\/de\/virtuelle-server\/wie-kann-ich-mich-per-vnc-verbinden.html","data":{"post_id":"56525","post_slug":"wie-kann-ich-mich-per-vnc-verbinden","post_cat_id":"9"}}]}}