How to Troubleshoot SSH on MacOSX

Published Date Author: , Posted May 1st, 2010 at 11:36:58am

I had some odd issues with slow login via ssh to my host. I looked in Console.app, but was not able to find anything relevant.

So here is what I did:
1. System Preferences -> Sharing, Unchecked “Remote Login”
2. In Terminal, as root, ran
/usr/sbin/sshd -ddd -e
(3 d’s for debug level 3, -e to send the output to the standard error)
3. Attempted to ssh into this host and watched the output from sshd

What I found was that sshd was unable to do a reverse DNS lookup on the source IP address, and was timing out, which accounted for the long delay I was experiencing.

I checked in /Library/Logs/named.log and found the following error:

zone 0.168.192.in-addr.arpa/IN: has no NS records

This meant that there was something wrong with the DNS configuration file for reverse lookups.

To determine the correct configuration file location, I checked /etc/named/conf.

From there I checked the appropriate file in /var/named.

It turned out that the reverse lookup configuration file was missing the NS definition line.

After adding the proper entry and restarting named via a simple kill, all was working well.

Oh, and I reenabled sshd in System Preferences -> Sharing, by checking the “Remote Login” box.

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.