So I have ssh access to my desktop computer at work, I use Endpoint security VPN on my mac to connect to the desktop computer. Which works great, I can access most internal IPs through this VPN. However there seems to be internal IPs that I can only connect to on my Desktop PC at work. Is there anyway I can use my desktop computer at work to act as an in-between, to send traffic that I request from my home computer and then forward it to the actual internal server and send the result back to the home computer?
I have tried searching on here and google but either don't understand the results or have a feeling that it wasn't what I was looking for. I have been looking into ssh tunnelling but not sure if that is what I'm looking for. Thanks!
Answer
Ya you can use SSH Tunneling
to achieve this. Let us assume that your machines are macbook
, desktop
and internal_box
. internal_box
can only be SSHed from desktop
machine. Then you first create the tunnel on your macbook
to internal_box
via desktop
using
ssh -L 2222:internal_box:22 user@desktop
Thsi will open port 2222
on macbook
and forward all the packets to 2222
via desktop
to port 22
of internal_box
. So now internal_box
is avilable at port 2222
of macbook
So you can connect to internal_box
using
ssh user@127.0.0.1 -p 2222
If the above SSH
succeeds, then you are connected to your ``internal_boxon your
macbookvia
desktop`. Hope that helps.
No comments:
Post a Comment