
- SSH REVERSE TUNNEL EXAMPLE HOW TO
- SSH REVERSE TUNNEL EXAMPLE MANUAL
- SSH REVERSE TUNNEL EXAMPLE DOWNLOAD
The -D option specifies dynamic port forwarding. First you would use dynamic port forwarding with the default SOCKS port: Each program that uses the proxy server needs to be configured specifically, and reconfigured when you stop using the proxy server.įor example, say you wanted Firefox to connect to every web page through your SSH server. SOCKS is a little-known but widely-implemented protocol for programs to request any Internet connection through a proxy server. For the duration of the SSH session, Joe would be able to access your desktop by connecting a VNC client to port 5900 on his computer (if you had set up a shared desktop).ĭynamic port forwarding turns your SSH client into a SOCKS proxy server. Ssh -R 5900:localhost:5900 -R option specifies remote port forwarding. You would use port number 5900 (the first VNC port), and destination server localhost: You should already know your destination server, and for basic uses of port forwarding, you can usually use the port numbers in Wikipedia's list of TCP and UDP port numbers.įor example, say you wanted to let a friend access your remote desktop, using the command-line SSH client. To use remote port forwarding, you need to know your destination server, and two port numbers. Remote port forwarding lets you connect from the remote SSH server to another server. The word "localhost" is the computer equivalent of the word "yourself", so the SSH server on your laptop will understand what you mean, whatever the computer's actual name. Connecting an SSH client to localhost port 5900 would show the desktop for that computer. This would forward connections to the shared desktop on your SSH server (if one had been set up).
SSH REVERSE TUNNEL EXAMPLE DOWNLOAD
This would forward two connections, one to the other to Pointing your browser at would download pages from and pointing your browser to would download pages from The destination server can even be the same as the SSH server. Ports numbers less than 1024 or greater than 49151 are reserved for the system, and some programs will only work with specific source ports, but otherwise you can use any source port number. In the above example, we used port 8080 for the source port. For the duration of the SSH session, pointing your browser at would send you to. The -L option specifies local port forwarding. Where should be replaced by the name of your laptop. You would use source port number 8080 (the alternate http port), destination port 80 (the http port), and destination server : You should already know your destination server, and for basic uses of port forwarding, you can usually use the port numbers in Wikipedia's list of TCP and UDP port numbers.įor example, say you wanted to connect from your laptop to using an SSH tunnel. To use local port forwarding, you need to know your destination server, and two port numbers. Local port forwarding lets you connect from your local computer to another server.
SSH REVERSE TUNNEL EXAMPLE HOW TO
Again, exactly how to do this depends on which SSH client you use, so you may need to consult your documentation. If you're using dynamic port forwarding, you need to configure your programs to use a SOCKS proxy server. If you're using local or remote forwarding, you need to tell your client the destination server. You also need to tell your client the source and destination port numbers to use. To use port forwarding, you need to make sure port forwarding is enabled in your server.
SSH REVERSE TUNNEL EXAMPLE MANUAL
For example, the PuTTY manual has a section on port forwarding in PuTTY. For help on using a specific client, consult the client's documentation. Port-forwarding is a widely supported technique and a feature found in all major SSH clients and servers, although not all clients do it the same way. Although this is very powerful, it takes a lot of work to set up, and it's usually easier to use local port forwarding for the specific sites you want to access.

For example, dynamic port forwarding lets you bypass a company firewall that blocks web access altogether. For example, remote port forwarding lets you connect from your SSH server to a computer on your company's intranet.ĭynamic port forwarding is rarely used. For example, local port forwarding lets you bypass a company firewall that blocks Wikipedia. Local port forwarding is the most common type. Remote port forwarding: connections from the SSH server are forwarded via the SSH client, then to a destination serverĭynamic port forwarding: connections from various programs are forwarded via the SSH client, then via the SSH server, and finally to several destination servers Local port forwarding: connections from the SSH client are forwarded via the SSH server, then to a destination server There are three types of port forwarding with SSH: Even if you don't agree with that reason, your IT department might not take kindly to you flouting their rules. Warning: Filtering and monitoring is usually implemented for a reason.
