From charlesreid1

Line 16: Line 16:


From the client, you'll connect to the server with the ssh command, but with some additional flags that create the SSH tunnel: <code>ssh -L <local-port>:localhost:<remote-port> username@10.1.1.101</code>
From the client, you'll connect to the server with the ssh command, but with some additional flags that create the SSH tunnel: <code>ssh -L <local-port>:localhost:<remote-port> username@10.1.1.101</code>
Here is what the syntax means:
to forward port 8001 on my local machine, the client, to port 8000 on the remote machine, the server, at IP address 10.1.1.101, I will run the following ssh command:
<pre>
ssh -L 8001:localhost:8000 username@10.1.1.101
</pre>


=References=
=References=

Revision as of 06:00, 13 March 2016

SSH for Linux Tasks

many useful tasks that can be done over SSH. unfortunately, most windoze networks block port 22.

SSH tunnels

Mostly stuff we already know - but you can build ssh tunnels. This allows you to access services locally that originate from another computer or server.

This capability enables you to bypass local DNS filtering (by routing DNS queries through the SSH tunnel instead of to the network's default DNS).

It also allows you to access servers on a private network, from a remote location.

Create ssh tunnel

You need ssh on both the client and server side. You'll run an SSH server on the server side, and connect to it with an SSH client on the client side.

From the client, you'll connect to the server with the ssh command, but with some additional flags that create the SSH tunnel: ssh -L <local-port>:localhost:<remote-port> username@10.1.1.101

Here is what the syntax means:

to forward port 8001 on my local machine, the client, to port 8000 on the remote machine, the server, at IP address 10.1.1.101, I will run the following ssh command:

ssh -L 8001:localhost:8000 username@10.1.1.101

References

"Mastering Linux"