Suppose I do a SSH session chain within one single unique terminal window (RHEL6)

  1. open terminal on localMachine, SSH remote login to server1
  2. from server1, SSH remote login to server2
  3. from server2, SSH remote login to server3
  4. from server3, SSH remote login to localMachine

What happen to all these SSH sessions when I close the terminal window without typing all the sucessive exit commands ?

I suppose that only the first session is closed properly ? (localMachine-server1) Do all the other sessions remain until some inactivity timeout occur ?

Security is not an issue here. SSH is just used as a way to do remote logins.

1 Answer 1


All sessions will stop as the get signalled with SIGHUP. (Assuming you did nothing to prevent that signal from being processed).
There is no timeout for that, just a minimal delay as the signal causes the process to be stopped, which causes the SIGHUP on the next, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .