Resolving WinSSHD Connection Problem on Mac OSX 10.7 Lion

If you've had problems connecting to servers over SSH after upgrading to Lion, you aren't alone and thankfully, there's a simple fix. Problem

From the command line, the following command will initiate an SSH connection to some server on port 60001.

$> ssh -p 60001

There is nothing wrong with this command. It works, unless the SSH server you are connecting to doesn't recognize the terminal that is requested.

The error you get back isn't terribly helpful if you aren't sure how the SSH connection is formed. The terminal that you are using is sent along so that SSH knows how to interact with your SSH client. This comes the TERM environment variable.

In Snow Leopard, the requested terminal is xterm-color. In Lion, the requested terminal is xterm-color256.

You can verify this by echoing the TERM out:

$> echo $TERM

I discovered this by looking at the SSH server logs on the Windows box I was trying to connect to. I love reading server logs. So straight forward...

WinSSHD doesn't recognize xterm-color256. At least mine doesn't, and I just installed it on a couple of shiney new VMs. If you do the Google on this problem, lots of folks will tell you to just copy the terminal config files to the SSH server. Well, that's not the recommended way of doing it. In fact, the makers of WinSSHD request that you send the unsupported terminal info to them and they'll include support for it in their next release. How helpful.


Before running your connection command, set your TERM environment variable to xterm-color and you'll be just fine.


Or, whatever syntax your shell requires.