Changing the default sshd port on Snow Leopard

Changing the default sshd port on Snow Leopard

Many years ago, I needed to change the port that sshd listens on on my Mac. Which I managed at the time, but I don’t remember how I did it.

As is usually the case, I “hit up” Google (as the kidz are wont to say, I think) and after a bit of trawling I found the solution:

  1. Open Terminal and as edit the file /etc/services (as root)
  2. Add a line at the bottom: secret-ssh 43539/tcp # secret SSH port
  3. Edit file /System/Library/LaunchDaemons/ssh.plist and replace the code:
    <key>SockServiceName </key>
    <string>ssh </string>
    

    with

    <key>SockServiceName </key>
    <string>secret-ssh </string>
    
  4. Change your port forwarding configuration on your firewall to route port 43539 instead
  5. Open “Sharing” control panel and ensure that “Remote Login” is checked off (if not uncheck it). Then check it again to start with the new configuration.

I got this information from this page here, and, if you look in the comments there, you’ll see it’s the exact page I’d come across originally. Here lies a lesson: bookmarks!

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.