• How to change the default SSH port in OSX Server

    So you don’t want to have your remote login port (ssh port) on your OSX server setup to port 22. You can easily change the listening port doing the following 2 steps. There is no need to add another service.
    First you will need to edit your Lion Services file:

    sudo nano /etc/services

    Search for the following 2 lines in your Services file.

    ssh              22/udp     # SSH Remote Login Protocol
    ssh              22/tcp     # SSH Remote Login Protocol

    Change the 22 to a number you wish (preferably above 5000)

    ssh              11223/udp     # SSH Remote Login Protocol
    ssh              11223/tcp     # SSH Remote Login Protocol

    Turn off remote login, then turn it back on.

    You can now SSH into your Lion server using a custom port and it will no longer be listening on 22.


    Leave a reply