views:

1028

answers:

3

I am having an issue with SSH hanging on my Mac Book Pro. This only happens to me once I get home from work after I have used SSH while at work. The three factors I have narrowed the issue down to are SSH, our work AFS network drive and the method of network connectivity.

At work we use an AFS drive with Kerberos Authentication to do all of our software development work on. I authenticate with Kerberos in order to gain access to the AFS drive where all my source code lives, but I open a local editor (Eclipse) which references the files on the AFS drive. Whenever I need to compile my code, I SSH in to my development server (which is also authenticated to the AFS drive) and compile from there. (Sanity Note: I know that it is a super wacky setup, but I promise I had NOTHING to do with it. I'm just making do with what I've got.)

For my Network Preferences, I use the Automatic location all the time. For that configuration I have Built-in Ethernet en1 configured to use DHCP and our company's DNS server for when I'm at work (there is no wireless available). When I go home I connect to my home network via wireless, again using DHCP.

I have a hunch that the AFS connection/Ethernet configuration is somehow the culprit here. Restarting the SSH daemon doesn't correct the problem. The only way I have found to correct the issue is by restarting the computer each time I want to use SSH. Keep in mind that I have no other (known) networking issues while at home after I've had the laptop at work.

I have a co-worker who has reported to me the same issue on his MBP.

I'm truly stumped on this one. Please provide some guidance. Thanks!

A: 

Just a shot in the dark: I recently had problems using ssh after installing Rogue Amoeba Audio Hijack Pro. I could only use ssh as super user (sudo). An Update to 2.8.1 resolved the issue...

Also see http://www.macobserver.com/article/2008/03/19.8.shtml for the issue.

stigi
+1  A: 

Can you be more specific about "SSH hanging"?

It sounds like your ssh client hangs after losing the connection and you are unable to do anything in the terminal. To get around this, you can use the ssh escape character (default: ‘~’) to begin an escape sequence, and use the the '.' to terminate the connection.

You can get a list of other ssh escape sequences using ~?, here's the one for OpenSSH SSH client:

Supported escape sequences:
~.  - terminate connection
~B  - send a BREAK to the remote system
~C  - open a command line
~R  - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~#  - list forwarded connections
~&  - background ssh (when waiting for connections to terminate)
~?  - this message
~~  - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

If typing ~. does not work, it could be that you have the escape character disabled, in which case you can put

EscapeChar ~

inside ~/.ssh/config or */etc/ssh_config*

Even when the escape character is disabled, you can simply pull up another Terminal window and type

killall ssh

to end all running ssh processes, allowing you to connect out again.

Restarting the SSH daemon would not correct this problem because sshd allows other clients to connect in to your machine, and does not affect your ssh clients connecting out to some other machine.

Paul Ivanov
+1  A: 

It appears that the fix for my issue is to delete my Kerberos tokens that are valid while at work, but not valid when at home. Hope this can help anyone having a similar issue.

localshred