0

I have a webserver WWW1 and a front-facing proxy PRX. I use SSH ProxyCommand to connect to WWW1's internal IP (private IP) via PRX (private+public IP). For some connections (not all) I see a network connection left open after I'm finished. These add up!

~/.ssh/config

Host *
  ServerAliveInterval 5
  ControlMaster auto
  ControlPath ~/.ssh/master-%r@%h:%p

Host WWW1 WWW2 WWW3
  User foo
  ProxyCommand ssh -q -a -x PRX nc %h 22
  IdentityFile ~/.ssh/id_foo_WWWx

On PRX, lsof | grep WWW1:ssh shows 124 open connections at the moment. On WWW1, the same command shows 243 open connections. There are similar open connections for WWW2, WWW3 etc.

WWW1 and PRX are Debian. Client connections are coming from a mix of Debian, Ubuntu and OSX10.6. I use Emacs Tramp but this has no special configuration (AFAIK) outside of my ~/.ssh/config.

I'm concerned about running out of internal ports, and ideally I want these connections to clean themselves up without intervention. Ideally by configuring them to kill themselves off; failing that a command I can kill old processes with is fine!

1
  • This question, which I initially thought better suited for SuperUser, earned a Tumbleweed badge here for lack of response after some weeks. I reposted it verbatim on StackOverflow and had a solution in five minutes: stackoverflow.com/questions/5816489/… Apr 28, 2011 at 10:11

1 Answer 1

1

Add -w 1 to nc parameters.

  ProxyCommand ssh -q -a -x PRX nc %h 22
1
  • Credit for this answer to sehe @ stackoverflow. May 6, 2011 at 4:05

You must log in to answer this question.

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