Score:2

Is it possible to have multiple users SSH tunnel to a same local port?

us flag

I have a web-app running on a particular port on a Linux EC2 instance. Only SSH traffic is allowed to that server.

Can multiple clients use SSH tunnels to that server to load a webpage from that port?

Score:5
pf flag

Definitely. You can easily try this with your own user. Just open up two terminals and start two SSH sessions to proxy that same server port.

Session #1:

ssh -L 8080:127.0.0.1:80 [email protected] -NT

Session #2:

ssh -L 8081:127.0.0.1:80 [email protected] -NT

Notice I used two different local ports (8080 and 8081), otherwise the second session would error out. When multiple users connect from different machines, that won't apply.

jcaron avatar
co flag
Just for completeness for other readers in slightly different scenarios, let's also note that of course, the reverse won't be true: if you use reverse port forwarding (-R) the port on the remote server can't be the same for multiple users.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.