Reputation: 4229
A service, for example an FTP server, only accepts connections from a specific network, where all users will have the same external IP-adress.
I want to connect to this service, but I'm currently not inside the allowed network.
I have ssh access to a server inside the network.
How do I use ssh to tunnel a certain port from my local machine, through a machine on the internal network, to the final service, so that any client opening the correct port won't notice any difference?
Upvotes: 1
Views: 11818
Reputation: 600
You can create a SSH tunnel to your specific network using the following command. For instance, let's say you want to reach a web service on computer "mywebserver" (port 80).
ssh -f mysshserver -L 1234:mywebserver:80 -N
This will open a SSH tunnel between local port 1234 and remote webserver on port 80. You can then open your web browser and connect directly to your web server by typing "http://localhost:1234" in the address bar.
Upvotes: 3