I want to connect to server B which is behind a firewall, using AliasForB. I SSH to server A first, and then from there I can SSH to server B. I am attempting to connect directly to server B by typing shorthand "ssh AliasForB". Both A and B require different usernames.

Based on a previous response, I used the following configuration, however, there is a small problem. When I close the connection, it appears that the connection on A is "killed" rather than closed gracefully. How can I fix this?

$> logout
Connection to B closed.
Killed by signal 1.

My configuration:

Host AliasForA
     Hostname FQDN.for.A.com
     User MyUsernameForA


Host AliasForB
     Hostname FQDN.for.B.com
     User MyUserNameForB
     ProxyCommand ssh AliasForA nc -w 3 %h %p
link|improve this question

75% accept rate
1  
Why are you even worrying about this? In the great grand scheme of things, having nc get a HUP barely even rates a mention in the badness stakes. – womble Sep 17 '09 at 0:20
feedback

1 Answer

up vote 2 down vote accepted

Signal 1 is SIGHUP-- i.e. "hang up". It isn't "not graceful"-- netcat is just stopping because sshd sends it a SIGHUP. Yeah, yeah-- other people are annoyed by it, too, but it's really no big deal. Here's the backstory about it, BTW.

link|improve this answer
I'd just add that SSH is behaving properly. If you have an application that you want to persist in the event of a SIGHUP, you can use nohup or launch it with a wrapper that intercepts the signal and does whatever you define as "graceful". – duffbeer703 Sep 17 '09 at 1:33
feedback

Your Answer

 
or
required, but never shown

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