Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
     User MyUsernameForA

Host AliasForB
     User MyUserNameForB
     ProxyCommand ssh AliasForA nc -w 3 %h %p
share|improve this question
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
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.

share|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

Your Answer


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.