Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
There are three different types of SSH tunneling, and theyre all
used for different purposes. Each involves using an SSH server to
redirect traffic from one network port to another. The traffic is sent
over the encrypted SSH connection, so it cant be monitored or
modified in transit.
You can do this with the ssh command included on Linux, macOS,
and other UNIX-like operating systems. On Windows, which
doesnt include a built-in ssh command, we recommend the free
tool PuTTY to connect to SSH servers. It supports SSH tunneling,
too.
Local Port Forwarding: Make Remote
Resources Accessible on Your Local System
For example, lets say the database server at your office is located
at 192.168.1.111 on the office network. You have access to the
offices SSH server at ssh.youroffice.com , and your user
account on the SSH server is bob . In that case, your command
would look like this:
In this case, you could run a command like the following one:
Assuming you can access a remote SSH server, you can connect
to that SSH server and use remote port forwarding. Your SSH
client will tell the server to forward a specific portsay, port 1234
on the SSH server to a specific address and port on your current
PC or local network. When someone accesses the port 1234 on
the SSH server, that traffic will automatically be tunneled over the
SSH connection. Anyone with access to the SSH server will be
able to access the web server running on your PC. This is
effectively a way to tunnel through firewalls.
Someone could then connect to the SSH server at port 8888 and
that connection would be tunneled to the server application
running at port 1234 on the local PC you established the
connection from.
To do this in PuTTY on Windows, select Connection > SSH >
Tunnels. Select the Remote option. For Source Port, enter the
remote port. For Destination, enter the destination address and
port in the form local_address:local_port.
People could then connect to port 8888 on the SSH server and
their traffic would be tunneled to port 1234 on your local system.
The tunnel will remain active and open for as long as you have the
SSH session connection open. When you end your SSH session
and disconnect from a server, the tunnel will also be closed. Just
reconnect with the appropriate command (or the appropriate
options in PuTTY) to reopen the tunnel.
SHARE:
COMMENTS: 6
Disclaimer: Most of the pages on the internet include affiliate links, including some on this site.