PDA

View Full Version : SSH change default port via ssh.plist




bartezzini
Apr 22, 2011, 12:46 PM
:confused: I have to change SSH default port on Snow Leopard server. There's a hint that works with my home snow leopard but don't work on server why?
This method edit ssh.plist
<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>22022</string>
</dict>
</dict>



calderone
Apr 22, 2011, 11:08 PM
What is up with the Listeners2?

You can define the port on the existing listener. For example:


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


Also, to have it take effect immediately:
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist