Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am seeing some odd behavior when using the Terminal app to open an ssh window to a remote machine. I normally connect to many different Linux servers from my MacBook Pro running Mac OS X 10.7.3, with Terminal 2.2.2 (303).

I have a list of the servers' IP addresses in the New Remote Connection window's ssh group. When I select one of the servers (10.x.y.120, for instance), enter a username, and click Connect, an ssh window opens and I can enter my password and get to work.

However, starting yesterday, for a couple of the machines (10.x.y.182 and 10.x.y.194), when I follow this procedure an ssh window opens and then immediately disappears. For other servers, the window opens as usual.

Here's the kicker: If I open a terminal window on my MacBook Pro itself, then run ssh on the command line to the machine that I can't reach through the New Remote Connection window, the connection works perfectly. It only fails when I do it through Terminal.

I have tried deleting the entry in New Remote Connection, and creating it again, but that didn't help. This is happening on a machine that was just restarted. One thing that did change was that I applied the latest Mac OS updates over the weekend. I don't remember which versions they were.

Things used to work last week, so something broke recently. Are there any logs I could look at for more information? Are there any configuration or data files that might have become corrupt? Thanks in advance for your help.

share|improve this question
1  
For logs to look at take a look at Console.app -- try viewing Console while you attempt to log in. Anything useful come up? –  Ian C. Feb 28 '12 at 20:14
    
To answer Ian C's question, Console shows "login: USER_PROCESS" then on the next line "login: DEAD_PROCESS". I guess the Terminal window process is crashing. –  Randall Cook Feb 28 '12 at 20:20
    
FWIW, I can't reach web pages on the servers in question (.182 and .194). I get connection failures almost instantly with Chrome (haven't tried Safari), but the other machines' web pages are quite reachable. –  Randall Cook Feb 28 '12 at 23:12
    
That really suggests a problem with your servers. If it's intermittent, likely a load issue. –  Ian C. Feb 29 '12 at 14:05
    
It’s surprising that New Remote Connection would not behave exactly the same as entering an ssh command at the shell prompt, because all New Remote Connection does is build an ssh command and execute it. Compare the parameters you manually entered to the ones produced by New Remote Connection to see if there’s a difference that changes the behavior to be the same. –  Chris Page Apr 1 '12 at 10:06
add comment

1 Answer

Here's what happened. On the machines I was trying to reach (10.x.y.182 and 10.x.y.194), in the time when I was not using them they had their hard disks replaced and the OS reinstalled. This gave them new SSH keys, invalidating the ones I had in my ~/.ssh/known_hosts file. Unfortunately, Terminal.app did not surface this problem to me.

By deleting the entries for those machines in ~/.ssh/known_hosts, I forced the system to pull down the new keys and ask me if I wanted to use them. With this done, connections worked perfectly as usual. Oddly, however, even before I changed ~/.ssh/known_hosts, connections using the DNS name of the machine (svr10 and svr20) worked. Weird.

Thanks, everyone, who looked at this problem.

share|improve this answer
1  
“Unfortunately, Terminal.app did not surface this problem to me.” New Remote Connection just constructs and executes an ssh command. It will produce the exact same ssh messages in the terminal whether you entered it manually at the command prompt or used New Remote Connection. The difference is that you apparently have Terminal preferences configured to close the terminal window when the ssh command ends, so you didn’t have time to read the ssh errors. –  Chris Page Apr 1 '12 at 10:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.