Mac OS X – Extra Listening port for SSH

Firstly make SSH listen on an extra port, say 2222:

<key>Sockets</key>
<dict>
         <key>Listeners</key>
         <dict>
                 <key>SockServiceName</key>
                 <string>ssh</string>
                 <key>Bonjour</key>
                 <array>
                         <string>ssh</string>
                         <string>sftp-ssh</string>
                 </array>
         </dict>
         <key>Listeners2</key>
         <dict>
                 <key>SockServiceName</key>
                 <string>2222</string>
         </dict>
</dict>

Reload the file by executing:

launchctl unload /System/Library/LaunchDaemons/ssh.plist
launchctl load /System/Library/LaunchDaemons/ssh.plist

Leave a Reply

Your email address will not be published. Required fields are marked *