Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm using ~/.ssh/config for logging to the internal.local corporate server:

Host internal.local
    ProxyCommand ssh -e none corporate.proxy nc %h %p

But after closing session (typing exit), my sshd session on server stays still active (I see it through different connection).

Hot do I close session or change my config in the appropriate way, to eleminate hang sessions?

First check from the second, root session: ps -fu user_name

user_name 861   855   0 16:58:16 pts/3       0:00 -bash
user_name 855   854   0 16:58:13 ?           0:00 /usr/lib/ssh/sshd

After logging out:

user_name 855   854   0 16:58:13 ?           0:00 /usr/lib/ssh/sshd

Just after scp files to/from the internal.local a new scp sessions still hangs on the server.

share|improve this question

migrated from Aug 30 '12 at 8:51

This question came from our site for professional and enthusiast programmers.

You might have some processes still running in the SSH session. The connection will stay up until they finish. – Peter Westlake Aug 29 '12 at 12:54
Just ssh internal.local then exit. – egor7 Aug 29 '12 at 12:56
thanks for mention „-e none“ sometimes ~. is usefull, but most time it sucks to type „~ “ to type a tilde. ;-) – ThorstenS Aug 30 '12 at 9:03


# for Solaris
ProxyCommand ssh -e none corporate.proxy nc %h %p -c


# for *nix
ProxyCommand ssh -e none corporate.proxy nc %h %p -w 5

-c cause to close connection after doing work on Solaris, and -w is the same on *nix systems.

share|improve this answer

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.