SSH should be relatively easy to set up in OS X, consisting merely of ticking the box marked “Remote Login” in the “Sharing” pane of System Preferences.
That should enable you to log in from any computer on the local network, router considerations aside. I, however, found that I was struggling to connect from a different machine. After checking and double-checking everything, I finally stumbled across a post which suggested that the Mac firewall might be the problem. Sure enough, a quick check of the log showed that requests from the local machine (192.168.1.64) were being denied:
When you enable any kind of sharing, Mac OS automatically updates the firewall to let that traffic through. However, it seems that in some cases it doesn’t actually work! Even though “Remote Login (SSH)” was showing as allowed in my Firewall settings, I had to change the firewall to “Allow all incoming connections“, connect from the remote machine, and then set the firewall back to “Set access for specific services and applications“. This did the trick, and I found that everything then immediately worked as it should. That’s worth remembering.
You are a scholar and a gentleman. Thank you!
Its not enough to have Remote Login(SSH) to allow incoming connections in the firewall control panel. You have to make sure that also the process “sshd-keygen-wrapper” is set to allow incoming connections!
Never leave your firewall to Allow all incoming connections!