0

I am setting Linux Hopping Station to another different servers.

My current config to connect to another servers is using different port to connect.

e.g

ssh -D 1080 -p 22 username@server1.com

ssh -D 1081 -p 22 username@server2.com

Now what I would like to have to share the same port from the same box.

ssh -D 1080 -p 22 username@server1.com

ssh -D 1080 -p 22 username@server2.com

But when I share it, I will get below error:

bind: Address already in use channel_setup_fwd_listener: cannot listen to port: 1080 Could not request local forwarding.

How could I configure the same port? help. thank you.

I want to share the same port because this is needed when configuring firewall in Citrix Firewall on other machine, not needed to many many ports and keep changing when changing connection.

thank you.

  • Why do you need more then one connection? The -D port number selected should not make an difference to the any computer other then on ssh client, and by default that will listen on the loopback interface which is usually immune from firewall blocking. – Zoredache Apr 30 '10 at 19:45
1

You can only do that if you have two different IP addresses on that machine. If it's only for local usage, you can use the 127.0.0.1/8 address space like in:

ssh -D 127.0.0.1:1080 -p 22 username@server1.com
ssh -D 127.0.0.2:1080 -p 22 username@server2.com

Best of luck,
João Miguel Neves

  • Hi Joao, still i m getting the same error. is it possible for for you to guide me? thanks – regmaster May 13 '10 at 16:54
  • Any chance that port 1080 will be occupied in the client machine? Please post the output of netstat -nat | grep 1080 to check. – jneves May 13 '10 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.