SSH Port Forwarding - sharing the same port

Hi Linux/Unix Guru,

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.

:confused:

I don't understand. These servers are not public facing? You could shell in directly in that case.

There is no need to specify different ports for virtual hosts on the same server. As long as there is a user@domain with shell privileges, they can log in.

Now I do use my public facing server to act as a shell intermediary... I shell in to the gateway server, then shell in to the other servers behind it on the local network. Is that what you are doing?

I think yes.

Because the main purpose of that hopping station is established connection (tunneling) to different apps in different servers.

So I will send configuration for my users to use port 1081 and 1082 in their Citrix Firewall settings, 127.0.0.1 1082 or 1081

Then before that they have to login to my server via Putty.

Now all I want is to share the same port in my linux box. Is it possible?

No... As far as I know, only one process may have a port open.

1 Like