1

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
Ryan Rosario
  • 225
  • 2
  • 9
  • 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 00:20

1 Answers1

2

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.

Evan Anderson
  • 141,881
  • 20
  • 196
  • 331
  • 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 01:33