ssh port forwarding, who has access to localhost?
1
vote
0
answers
356
views
I've done an ssh remote port forwarding:
@host1.a.com% ssh -R 127.0.0.1:11999:host2.a.com:99 me@host3.b.com
My understanding is that this creates a TCP socket on host3.b.com's localhost port 11999.
I then checked that from host3.b.com I can indeed access the service exposed at host3.b.com's localhost port 11999.
I've also checked that I can login to host3.b.com
with a different ssh session (thus creating a new login shell) and can also access the service exposed at host3.b.com's localhost port 11999. This kind of scares me. I naively thought I'd get a different loopback interface for each login shell, but apparently not.
My question is: what about other people who can log into host3.b.com
like my friend buddy
and my enemy aHacker
? Do they get assigned to the same loopback interface that I get when I log into host3.b.com
? Or do they get their own private loopback interfaces and can't see my open port on my host3.b.com's localhost:11999? Is there a way to make sure that I'm the only user who can access a forwarded port?
Asked by Wandering Logic
(1611 rep)
Feb 28, 2023, 01:43 AM
Last activity: Feb 28, 2023, 06:08 PM
Last activity: Feb 28, 2023, 06:08 PM