How to change the SSH port on a Linux server




  • Avatar
    Cirrus Tecnologia

    When changing SSH port, shouldn't related fail2ban jail be adjusted, too?

  • Avatar
    Anton Maslov

    Hi Cirrus, yes it is also required to update fail2ban configuration. The article will be updated accordingly. 

  • Avatar
    John Bertin (Edited )

    Following this tutorial I was no longer access the server using SSH 

    After a bit of searching, I discovered that it is also necessary to add a custom rule in the Plesk firewall. Once I did this, I was able to access console on the new port. 

    PS. please update the guide to help others avoid being locked out as well. I used the following guide to solve the issue:





  • Avatar
    Ivan Postnikov (Edited )


    Yes, you are correct, the required port should be opened for connection in Plesk firewall or any alternative, which is used.

    That is why in the article we have the following note:

    "the new port must be opened in firewall."

Please sign in to leave a comment.

Have more questions? Submit a request