Sunday, September 6, 2015

Yosemite sshd Config

I'm going to assume that as an experienced user of OSX you know how to navigate sudo and making changes to files. With that said

There are a slew of tutorials out there explaining how to change the port of sshd on Yosemite. Some of them are right, others are quite misleading. One of them (the first google result I got) even suggested adding a second process as ssh2. This is NOT what you want to do if you (like me) simply want to change port 22 to some other ephemeral port. I had gone through a few of these and even added the second process as recommended, using macports openssh. Make your life easier and don't do this. There are simply two files you must edit, that is all.

1. /System/Library/LaunchDaemons/ssh.plist
<string>ssh</string> <string>2222</string>

2. /private/etc/sshd_config
Port 2222 ListenAddress 123.456.789.012

Reload the process after you've edited these two files.
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist sudo launchctl load /System/Library/LaunchDaemons/ssh.plist

No comments :

Post a Comment