Short version: disable and/or remove the JiWire dashboard widget if you have it.
Since I got my MacBook Pro with Leopard pre-installed I’ve never had a usable SSH connection. When I worked in the semi-conductor industry I worked over SSH 100% of the time, as the CAD tools only ran on company servers. Now I do local Rails development so I just avoided using SSH, like I edit files with TextMate over CyberDuck connection vs login and vi files. This works okay but I am a huge VIM user and it bothered me a little that I got a brand new Mac with unusable SSH connections. I’ve googled a lot about this and could never figure out why.
I also found out the problem was not just with SSH, but it was with my wifi. First the problem went away when I’m plugged in with an ethernet connection. Also I was not able to sustain any wifi connection without lags, all my Skype voice and video calls were getting chopped off. This really drove me crazy as I use Skype a lot. So last Friday I scheduled an appointment at the Genius Bar to see if the genius could help me with this. The guy was knowledgeable with all things Macs and he could tell that I am sorta a power user by the stuff I had running, so he skipped the usual debugs and he suspected it was either that I had something running that interfered with my wifi or it was a hardware problem. He created a new account, we logged in with that account, and the SSH problem went away. I tested a Skype voice call and it worked great. I logged back into my account and the problem went away. He even said he didn’t do anything but if it comes back bring it in again and we’ll debug more.
I didn’t occur to me until this morning that the difference was that my Dashboard widgets weren’t running. With most Macs the dashboard widgets aren’t loaded until you look at them the first time after you login. This morning I got into the office and my SSH connection was slow again, I looked at all the widgets I had running, and disabled the JiWire wifi hotspot locator widget, and boom, my SSH connection was normal again. I can’t believe I didn’t figure this out earlier, the JiWire widget scans for nearby APs and it was probably scanning way too often. I had the same widget on my PowerMac running Tiger for years and everything was fine though.
Just thought I’ll post this up in case someone out there has the same problem. I had tried everything from adding a SRV record for the SSH service to my domain, to SSH’ing to IP addresses to avoid all DNS problems, nothing helped.