4 ms·
How does this part work: -R laptop-behind-nat:22:localhost:22 This should open port 22 on the ssh-j.com server and connect it back to the laptop-behind-nat:22
by mbreese 6y ago
How does this part work:
-R laptop-behind-nat:22:localhost:22
This should open port 22 on the ssh-j.com server and connect it back to the laptop-behind-nat:22 , but this is already open. So, you're doing some firewall trickery to redirect 127.0.0.1:22 to a different port based on the username? And sshd isn't listening on 127.0.0.1:22?
If so, could a person also try:
-R laptop-behind-nat:22:localhost:22222
-R laptop-behind-nat:22:localhost:22223
-R laptop-behind-nat:22:localhost:22224
And try to find other tunnels that are open? Or is this also handled somehow in the firewall? I always try to avoid using ports for tunnels if I can avoid it on multi-user systems for this reason. This means using Unix sockets as much as possible for the permissions/security aspects. However, that also means that whatever tool I'm using also has to support Unix sockets. And in your case it would mean letting random people create "file" sockets on a server, which isn't necessarily a good idea.
- ValdikSS 6y agoAll port forwarding requests are bind to random localhost ports only. What client writes to the left part of -R command is not used in socket binding process, but saved in forwarding database called "pseudodns". The SSH daemon is customized for this task. When the client tries to connect to such socket, the request is "rewrote" back to real socket port number. Only TCP forwarding is possible, UNIX socket ("streaming") forwarding is not supported.