If you need to change the firewall port on SSHD for MacOSX Leopard 10.5
Follow the instructions below
Open Terminal and as edit the file /etc/services (as root)
sudo pico /etc/services
Scroll right down to the bottom and add the line
secret-ssh portnumber/tcp # secret SSH port
portnumber being your desired port number, when this has been added press ctrl & o and write the file out and then ctrl & x to exit
Now you will need to edit the file /System/Library/LaunchDaemons/ssh.plist
sudo pico /System/Library/LaunchDaemons/ssh.plist
Now locate the following
<key>SockServiceName <key>
<string>ssh</string>
and replace with this
<key>SockServiceName</key>
<string>secret-ssh</string>
Reboot & you should be able to connect via SSH using your desired port.
This has worked 100% fine for me let me know if you have any trouble
should one be concerned with simply changing the default port 22 in /etc/services? then you don’t have to change the ssh.plist …
Not really concerned about it, the guide above works great and is exactly what I was looking for!
Excellent post!
A restart isn’t required. You also just do:
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist