ssh debugging …

In: Uncategorized

14 Mar 2011

I love the command line especially when working remotely. Yes, logmein, vnc, teamview, etc. are useful, but when you need quick access or powerful command-line tools, nothing beats the shell.

The problem is what to do when it fails. Diagnosing connection problems over hostile networks with firewalls, packet filtering, and more can be a pain. I recently discovered 2 useful tips when trying to diagnose the client and server interactions. First, run ssh with -vvv. Second, run sshd with -Dddde. This gives you all the debugging info you need.

In this particular case, sshd appeared to starting correctly, and I could ssh @localhost but not @127.0.0.1. The culprit turned out to be FreeSSHD had already bound port 22. Starting sshd with -Dddde revealed this problem. Then I simply found the guilty process by netstat -ab. When I had run netstat -an before and saw the system listening on port 22, I had incorrectly assumed it was sshd. =P