Debugging SSH issues on OS X

Most common problems could be:

Directory permissions

directory permission permission code
/Users/[usename] 755 rwxr-xr-x
/Users/[usename]/.ssh 700 rwx——
/Users/[usename]/.ssh/id_rsa 600 rw——-

Modifications in SSH config files /etc/ssh/sshd_config

How to debug 

On the server:

– You could run another SSH process on different port, and monitor console log.
[cpp]
$ sudo /usr/sbin/sshd -d -p 4444
[/cpp]

The client:

– Connect to the newly instantiated SSH process on port 4444 (-p 4444) with -v (verbose) option and monitor the log.
[cpp]
ssh -v -p 4444 tmux@10.0.1.4 -i ~/.ssh/tmux_ssh
[/cpp]

Once you find the issue and fix it, you could restart the SSH server with the following commands:
[cpp]
$ sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
$ sudo launchctl load /System/Library/LaunchDaemons/ssh.plist
[/cpp]

Leave a Reply