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'm having an ssh tunnel connection which works fine from the command-line;

ssh -f -N -L -p 22

Now I'm trying to make this connect to connect on demand with xinetd. I've put this custom port in /etc/service (tool 4444/tcp), and made a config file in /etc/xinetd.d;

service tool
   socket_type     = stream
   instances       = 1
   wait            = no
   user            = root
   server          = /usr/bin/ssh
   server_args     = -f -N -L -p 22
   port            = 4444
   disable         = no

After restarting xinetd I try to connect to this poort with a wget and get the message;

bind: Address already in use

lsof -i nor netstat -a don't show any open 4444 on forehand.

share|improve this question
up vote 2 down vote accepted

The reason is that xinitd will bind to the port, and when ssh tries to use it, the port is already in use. To use xinetd, you should communicate with stdin/stdout with the child process.

You can find a pointer how to manage a ssh tunnel with xinetd here:

share|improve this answer
Yes, thank you, that did the trick! Although I knew that the problem was that the port was already in use I couldn't figure out how to setup the connection without the tunnel. When using the command="etc.etc." in de authorized_keys on the remote host it works flawlessly. – Ezeyme Feb 22 '12 at 15:48

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.