Pergunta

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?

Foi útil?

Solução

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).

  • Under Linux or BSD, using OpenSSH, you can use the following commandline:

ssh -f mysshserver -L 1234:mywebserver:80 -N

  • Under Windows, you can use MobaXterm which includes a simple graphical ssh tunnel builder

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top