Aim
We have PC A, PC B.
PC A is behind Proxy and we cannot change any setting about the network, PC B is behind NAT.
We want to use ssh to connect from B to A, so we need to make a reverse tunnel from A to B.
Assume you have setup the openssh server on PC B.
On PC A
$ ssh -R12345:localhost:22 <PC B userName>@<PC B ip> -p <PC B ssh server port> -i <PC B user private key>
- The above command will connect remote port 12345 to local port 22
- If you can connect to PC B, then
On PC B
$ ssh <PC B userName>@localhost -p 12345 -X
- We now connected to PC A from B with x11 supported
Local port binding
ssh -Llocalhost:8888:[target IP]:[target port] -i [private key] [target user name]@[target IP]
沒有留言:
發佈留言