ssh-tunnel
| rev 25 | rev 26 | ||||
|---|---|---|---|---|---|
| 206 | 206 | ||||
| 207 | .. code-block:: bash | 207 | .. code-block:: bash | ||
| t | 208 | t | 208 | ||
| 209 | # -g means gateway -R means remote port forwarding | ||||
| 210 | # prompt:~$ ssh -g -R <remote-port>:<localhost>:<local-port> <user>@<remote- | ||||
| > | host> | ||||
| 209 | user@joe:~$ ssh -g -R 8888:127.0.0.1:8888 user@mary | 211 | user@joe:~$ ssh -g -R 8888:127.0.0.1:8888 user@mary | ||
| 210 | 212 | ||||
| rev 24 | rev 25 | ||||
|---|---|---|---|---|---|
| 66 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 66 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 67 | 67 | ||||
| n | 68 | The remotehost SSH server doesn't need to be configured. | n | 68 | The remotehost just needs to have an SSH server installed, no configuration is n |
| > | eeded. | ||||
| 69 | 69 | ||||
| n | 70 | Just be sure its installed and running and that you have credentials to login. I | n | 70 | This server could be running anywhere on the internet, we just need credentials |
| > | t just needs to be installed and running and you just need credentials. | > | to login. | ||
| 71 | 71 | ||||
| n | 72 | To install openSSH-server on Debian or Ubuntu linux type: | n | 72 | To install openssh-server on Debian or Ubuntu linux type: |
| 73 | 73 | ||||
| n | 74 | .. code-block:: apache | n | 74 | .. code-block:: bash |
| 75 | 75 | ||||
| t | 76 | sudo apt-get install ssh | t | 76 | sudo apt-get install openssh-server |
| 77 | 77 | ||||
| 78 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. | 78 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. | ||
| > | > | ||||
| rev 23 | rev 24 | ||||
|---|---|---|---|---|---|
| 26 | **Can a network admin stop a person or computer from tunneling?** | 26 | **Can a network admin stop a person or computer from tunneling?** | ||
| 27 | 27 | ||||
| t | 28 | The Admin will typically not know about the tunnel. From his view a tiny conne | t | 28 | The Admin will typically not know about the tunnel. From his view a tiny conne |
| > | ction is being placed and is normally overlooked. The admin does have the abili | > | ction is being placed and is normally overlooked. The admin does have the abili | ||
| > | ty to block the default SSH port 22. You can build your tunnel over any port (p | > | ty to block the default SSH port 22. You can build your tunnel over any port (8 | ||
| > | ort 80 or 443). | > | 0 or 443). | ||
| 29 | 29 | ||||
| 30 | Article Scope | 30 | Article Scope | ||
| rev 22 | rev 23 | ||||
|---|---|---|---|---|---|
| 26 | **Can a network admin stop a person or computer from tunneling?** | 26 | **Can a network admin stop a person or computer from tunneling?** | ||
| 27 | 27 | ||||
| t | 28 | The Admin will typically not know about the tunnel. From his view a tiny conne | t | 28 | The Admin will typically not know about the tunnel. From his view a tiny conne |
| > | ction is being placed and is normally overlooked. The admin does have the abili | > | ction is being placed and is normally overlooked. The admin does have the abili | ||
| > | ty to block the default SSH port 22. You can build your tunnel over any port. | > | ty to block the default SSH port 22. You can build your tunnel over any port (p | ||
| > | ort 80 or 443). | ||||
| 29 | 29 | ||||
| 30 | Article Scope | 30 | Article Scope | ||
| rev 21 | rev 22 | ||||
|---|---|---|---|---|---|
| 8 | **My Story** | 8 | **My Story** | ||
| 9 | 9 | ||||
| t | 10 | My place of employment has a firewall and it blocks nearly all outbound protoco | t | 10 | My place of employment has a firewall and it blocks nearly all outbound protoco |
| > | ls and many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). | > | ls and many great sites, such as foxhop.net or youtube.com. I need a way to get | ||
| > | I needed a way to get around the blocks and not get caught. | > | around the blocks and not get caught. | ||
| 11 | 11 | ||||
| 12 | 12 | ||||
| rev 20 | rev 21 | ||||
|---|---|---|---|---|---|
| 209 | user@joe:~$ ssh -g -R 8888:127.0.0.1:8888 user@mary | 209 | user@joe:~$ ssh -g -R 8888:127.0.0.1:8888 user@mary | ||
| 210 | 210 | ||||
| t | 211 | #. When the tunnel opens, verify that mary is binding/listneing to 0.0.0.0:8888: | t | 211 | #. When the tunnel opens, verify that mary is binding/listening to 0.0.0.0:8888: |
| 212 | 212 | ||||
| 213 | .. code-block:: bash | 213 | .. code-block:: bash | ||
| rev 19 | rev 20 | ||||
|---|---|---|---|---|---|
| 186 | 186 | ||||
| 187 | network.proxy.socks_remote_dns user set boolean true | 187 | network.proxy.socks_remote_dns user set boolean true | ||
| t | t | 188 | |||
| 189 | |||||
| 190 | Remote tunnel a service | ||||
| 191 | ========================= | ||||
| 192 | |||||
| 193 | In this scenario we are running a development web server (port 8888) on our work | ||||
| > | station (joe) from our home network. | ||||
| 194 | We would like to grant access to this development web server to people on the wo | ||||
| > | rk network. We have ssh access | ||||
| 195 | to a host (mary) on the work network. | ||||
| 196 | |||||
| 197 | #. We must enable GatewayPorts in mary:/etc/ssh/sshd_config to allow binding to | ||||
| > | 0.0.0.0 instead of 127.0.0.1: | ||||
| 198 | |||||
| 199 | .. code-block:: config | ||||
| 200 | |||||
| 201 | # Allow this host to bind forwarded ports to 0.0.0.0 instead of 127.0.0.1 | ||||
| 202 | # Service will appear to run on this host, but will get forwarded over tunne | ||||
| > | l | ||||
| 203 | GatewayPorts yes | ||||
| 204 | |||||
| 205 | #. We create a remote port forwarding tunnel from joe to mary: | ||||
| 206 | |||||
| 207 | .. code-block:: bash | ||||
| 208 | |||||
| 209 | user@joe:~$ ssh -g -R 8888:127.0.0.1:8888 user@mary | ||||
| 210 | |||||
| 211 | #. When the tunnel opens, verify that mary is binding/listneing to 0.0.0.0:8888: | ||||
| 212 | |||||
| 213 | .. code-block:: bash | ||||
| 214 | |||||
| 215 | user@mary:~$ sudo netstat -nap | grep 8888 | ||||
| 216 | tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN | ||||
| > | 17921/0 | ||||
| 217 | tcp6 0 0 :::8888 :::* LISTEN | ||||
| > | 17921/0 | ||||
| 218 | |||||
| 219 | **Now people at work can access the home workstation web server running on joe b | ||||
| > | y connecting to \http://mary:8888 !** | ||||
| rev 18 | rev 19 | ||||
|---|---|---|---|---|---|
| 179 | 179 | ||||
| 180 | Then open vnc and point to 127.0.0.1:31338 or 127.0.0.1:31337 | 180 | Then open vnc and point to 127.0.0.1:31338 or 127.0.0.1:31337 | ||
| t | t | 181 | |||
| 182 | Tunnel DNS requests in firefox | ||||
| 183 | =================================== | ||||
| 184 | |||||
| 185 | about:config | ||||
| 186 | |||||
| 187 | network.proxy.socks_remote_dns user set boolean true | ||||
| rev 17 | rev 18 | ||||
|---|---|---|---|---|---|
| 8 | **My Story** | 8 | **My Story** | ||
| 9 | 9 | ||||
| t | 10 | My place of employment has a firewall and it blocks nearly all outbound protoco | t | 10 | My place of employment has a firewall and it blocks nearly all outbound protoco |
| > | l and many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). | > | ls and many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). | ||
| > | I needed a way to get around the blocks and not get caught. | > | I needed a way to get around the blocks and not get caught. | ||
| 11 | 11 | ||||
| 12 | 12 | ||||
| rev 16 | rev 17 | ||||
|---|---|---|---|---|---|
| 8 | **My Story** | 8 | **My Story** | ||
| 9 | 9 | ||||
| t | 10 | My place of employment has a bastard firewall and it blocks nearly all ports an | t | 10 | My place of employment has a firewall and it blocks nearly all outbound protoco |
| > | d many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). I n | > | l and many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). | ||
| > | eeded a way to get around the blocks and not get caught. | > | I needed a way to get around the blocks and not get caught. | ||
| 11 | 11 | ||||
| 12 | 12 | ||||
| rev 15 | rev 16 | ||||
|---|---|---|---|---|---|
| 136 | .. code-block:: bash | 136 | .. code-block:: bash | ||
| 137 | 137 | ||||
| t | 138 | ssh -ND 7070 user@remotehost_ip | t | 138 | ssh -D 7070 user@remotehost_ip |
| 139 | 139 | ||||
| 140 | You will be prompted for credentials on the remotehost. | 140 | You will be prompted for credentials on the remotehost. | ||
| rev 14 | rev 15 | ||||
|---|---|---|---|---|---|
| t | 1 | rymMyO <a href="http://ccfdfrkqyubk.com/">ccfdfrkqyubk</a>, [url=http://cgtazrw | t | 1 | SSH Tunnel for HTTP Traffic |
| > | htfgg.com/]cgtazrwhtfgg[/url], [link=http://cxrmntdtgsvz.com/]cxrmntdtgsvz[/link | ||||
| > | ], http://rwlmlnhtyvae.com/ | ||||
| 2 | ============================== | ||||
| 3 | |||||
| 4 | **Are You stuck behind a firewall?** | ||||
| 5 | |||||
| 6 | Does your school, library, work, or parents control where you surf and what por | ||||
| > | ts you have open? Do you surf on such public domains and need more privacy? Are | ||||
| > | you sick of failing proxies? If you answered 'Y' to any of these questions then | ||||
| > | this tutorial is for you. | ||||
| 7 | |||||
| 8 | **My Story** | ||||
| 9 | |||||
| 10 | My place of employment has a bastard firewall and it blocks nearly all ports an | ||||
| > | d many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). I n | ||||
| > | eeded a way to get around the blocks and not get caught. | ||||
| 11 | |||||
| 12 | |||||
| 13 | |||||
| 14 | .. contents:: Sections | ||||
| 15 | |||||
| 16 | Common Questions | ||||
| 17 | ------------------- | ||||
| 18 | **What is the best way to get around a firewall?** | ||||
| 19 | |||||
| 20 | Create an SSH tunnel from the work network to your home network. | ||||
| 21 | |||||
| 22 | **My network administrator is smart, will I get caught?** | ||||
| 23 | |||||
| 24 | No, you will most likely not get caught. All the firewall sees is a connection | ||||
| > | to a resource on the internet. When you browse the web using the tunnel all tr | ||||
| > | affic is encrypted. If a network administrator captured packets he would only g | ||||
| > | et garbage data. An SSH tunnel is basically a VPN between two computers or netw | ||||
| > | orks. 1337 | ||||
| 25 | |||||
| 26 | **Can a network admin stop a person or computer from tunneling?** | ||||
| 27 | |||||
| 28 | The Admin will typically not know about the tunnel. From his view a tiny conne | ||||
| > | ction is being placed and is normally overlooked. The admin does have the abili | ||||
| > | ty to block the default SSH port 22. You can build your tunnel over any port. | ||||
| 29 | |||||
| 30 | Article Scope | ||||
| 31 | ------------------- | ||||
| 32 | |||||
| 33 | .. _Putty.exe: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | ||||
| 34 | .. _Firefox: http://portableapps.com/apps/internet/firefox_portable | ||||
| 35 | |||||
| 36 | We will discuss the steps of building an SSH Tunnel for HTTP traffic between two | ||||
| > | computers on different networks. This guide will cover both windows and linux | ||||
| > | localhosts. | ||||
| 37 | |||||
| 38 | Throughout this guide I will use the following terms, here are the definitions: | ||||
| 39 | |||||
| 40 | *localhost* | ||||
| 41 | The computer at work or school. | ||||
| 42 | *remotehost* | ||||
| 43 | The computer or server that is offsite, which has the SSH server running. | ||||
| 44 | |||||
| 45 | **What you need ...** | ||||
| 46 | |||||
| 47 | #. Credentials to a remotehost running an SSH server. (openssh-server) | ||||
| 48 | #. A localhost computer crippled by a pesky network firewall. | ||||
| 49 | #. An SSH client, For windows get Putty.exe_ | ||||
| 50 | #. Firefox_ ( Portable is best ) | ||||
| 51 | |||||
| 52 | **Why is this the best method?** | ||||
| 53 | |||||
| 54 | #. Most of the configuration is done from the localhost (while at school or work | ||||
| > | ). | ||||
| 55 | #. You don't need admin rights to run Putty.exe_, just place it on a USB drive. | ||||
| 56 | #. You don't need admin rights to run Firefox_ Portable, just place it on a USB | ||||
| > | drive. | ||||
| 57 | #. No changes need to be made on the remotehost ssh server. | ||||
| 58 | |||||
| 59 | |||||
| 60 | SSH Tunnel created from a Windows localhost | ||||
| 61 | ----------------------------------------------- | ||||
| 62 | |||||
| 63 | Follow this guide if your localhost (school or work) computer is Windows based. | ||||
| 64 | |||||
| 65 | Configure the SSH Server | ||||
| 66 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 67 | |||||
| 68 | The remotehost SSH server doesn't need to be configured. | ||||
| 69 | |||||
| 70 | Just be sure its installed and running and that you have credentials to login. I | ||||
| > | t just needs to be installed and running and you just need credentials. | ||||
| 71 | |||||
| 72 | To install openSSH-server on Debian or Ubuntu linux type: | ||||
| 73 | |||||
| 74 | .. code-block:: apache | ||||
| 75 | |||||
| 76 | sudo apt-get install ssh | ||||
| 77 | |||||
| 78 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. | ||||
| > | |||||
| 79 | |||||
| 80 | Keep in mind that this doesn't have to be your server, you just need credentials | ||||
| > | for SSH. | ||||
| 81 | |||||
| 82 | |||||
| 83 | Configure the SSH Client | ||||
| 84 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 85 | #. Download Putty.exe_ if you haven't already, you should follow along. | ||||
| 86 | |||||
| 87 | #. Double click Putty.exe_. | ||||
| 88 | |||||
| 89 | .. image:: http://engineer.siue.edu/puttyConnectScreen.gif | ||||
| 90 | |||||
| 91 | #. The 'Host Name (or IP address)' box should point to the SSH enabled remoteser | ||||
| > | ver. | ||||
| 92 | |||||
| 93 | #. Toggle the SSH radio button to set the port to 22. (The native SSH port). | ||||
| 94 | |||||
| 95 | #. Type a name into the 'Saved Sessions' box to save all the settings we toggle. | ||||
| 96 | |||||
| 97 | #. Click the save button. | ||||
| 98 | |||||
| 99 | #. There is a list of categories to the left of the putty window. | ||||
| 100 | |||||
| 101 | #. Navigate to: ( Connection > SSH > Tunnel ) | ||||
| 102 | |||||
| 103 | #. You should be at a menu that is labeled 'Options controlling SSH port forward | ||||
| > | ing'. | ||||
| 104 | |||||
| 105 | #. Click the 'Dynamic' radio button. | ||||
| 106 | |||||
| 107 | #. Leave 'Destination' text box blank. | ||||
| 108 | |||||
| 109 | #. Type '7070' into the 'Source port' text box. | ||||
| 110 | |||||
| 111 | #. Click the 'Add' button. | ||||
| 112 | |||||
| 113 | #. Save your configuration by going back to the 'Session' category, selecting yo | ||||
| > | ur saved session, and pressing the 'save' button. | ||||
| 114 | |||||
| 115 | #. Double-click your saved session. | ||||
| 116 | |||||
| 117 | #. A black terminal window should appear. | ||||
| 118 | |||||
| 119 | #. You will be prompted for a username and password. | ||||
| 120 | |||||
| 121 | #. You should be greeted by the server if successful. Leave the putty window op | ||||
| > | en. | ||||
| 122 | |||||
| 123 | #. `Configure Firefox... <#configure-firefox-to-use-the-ssh-tunnel>`_ | ||||
| 124 | |||||
| 125 | |||||
| 126 | SSH Tunnel created from a Linux localhost | ||||
| 127 | ------------------------------------------------ | ||||
| 128 | |||||
| 129 | Follow this guide if your localhost (work or school) computer is Linux. | ||||
| 130 | |||||
| 131 | Create the tunnel | ||||
| 132 | ~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 133 | |||||
| 134 | Open a terminal or console window, and enter the following command: | ||||
| 135 | |||||
| 136 | .. code-block:: bash | ||||
| 137 | |||||
| 138 | ssh -ND 7070 user@remotehost_ip | ||||
| 139 | |||||
| 140 | You will be prompted for credentials on the remotehost. | ||||
| 141 | |||||
| 142 | All you need to do is login to establish the tunnel. | ||||
| 143 | |||||
| 144 | |||||
| 145 | |||||
| 146 | Configure Firefox to use the SSH Tunnel | ||||
| 147 | ------------------------------------------ | ||||
| 148 | |||||
| 149 | Setup Socks 5 proxy. | ||||
| 150 | |||||
| 151 | #. Open Firefox_. | ||||
| 152 | |||||
| 153 | #. Click **Edit** -> **Preferences** | ||||
| 154 | |||||
| 155 | #. Click the **Advanced** and **Network** tabs. | ||||
| 156 | |||||
| 157 | #. Click the **Settings...** button. | ||||
| 158 | |||||
| 159 | #. Click the **Manual Proxy Configuration** radio button | ||||
| 160 | |||||
| 161 | #. In **Socks Host** type *localhost*. In port type *7070*. | ||||
| 162 | |||||
| 163 | .. image:: /attachment/ff-settings.jpg | ||||
| 164 | :align: left | ||||
| 165 | |||||
| 166 | You should now be able to browse the Internet using your remote connection. All | ||||
| > | data will be passed through the remote hosts internet connection. All traffic | ||||
| > | will be encrypted between the localhost and the remotehost. | ||||
| 167 | |||||
| 168 | |||||
| 169 | Tunnel to multiple vnc hosts behind a firewall | ||||
| 170 | ============================================================== | ||||
| 171 | |||||
| 172 | .. code-block:: bash | ||||
| 173 | |||||
| 174 | ssh -L <localport>:<remotehost>:<remoteport> <ssh-user>@<remote> | ||||
| 175 | |||||
| 176 | ssh -L 31337:remote.foxhop.net:5900 user@foxhop.net | ||||
| 177 | |||||
| 178 | ssh -L 31338:remote2.foxhop.net:5900 user@foxhop.net | ||||
| 179 | |||||
| 180 | Then open vnc and point to 127.0.0.1:31338 or 127.0.0.1:31337 | ||||
| rev 12 | rev 13 | ||||
|---|---|---|---|---|---|
| t | 1 | 2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmv | t | 1 | rymMyO <a href="http://ccfdfrkqyubk.com/">ccfdfrkqyubk</a>, [url=http://cgtazrw |
| > | tzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link | > | htfgg.com/]cgtazrwhtfgg[/url], [link=http://cxrmntdtgsvz.com/]cxrmntdtgsvz[/link | ||
| > | ], http://fknxjhefhdak.com/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcld | > | ], http://rwlmlnhtyvae.com/ | ||
| > | qe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeele | ||||
| > | uko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com/2qyQdJ <a href="http://sz | ||||
| > | qptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/u | ||||
| > | rl], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com | ||||
| > | /2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthm | ||||
| > | vtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/lin | ||||
| > | k], http://fknxjhefhdak.com/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcl | ||||
| > | dqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeel | ||||
| > | euko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com/2qyQdJ <a href="http://s | ||||
| > | zqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/ | ||||
| > | url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.co | ||||
| > | m/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrth | ||||
| > | mvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/li | ||||
| > | nk], http://fknxjhefhdak.com/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphc | ||||
| > | ldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkee | ||||
| > | leuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com/2qyQdJ <a href="http:// | ||||
| > | szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[ | ||||
| > | /url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.c | ||||
| > | om/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrt | ||||
| > | hmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/l | ||||
| > | ink], http://fknxjhefhdak.com/ | ||||
| rev 10 | rev 11 | ||||
|---|---|---|---|---|---|
| t | 1 | SSH Tunnel for HTTP Traffic | t | 1 | 2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmv |
| > | tzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link | ||||
| > | ], http://fknxjhefhdak.com/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcld | ||||
| > | qe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeele | ||||
| > | uko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com/2qyQdJ <a href="http://sz | ||||
| > | qptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/u | ||||
| > | rl], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com | ||||
| > | /2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthm | ||||
| > | vtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/lin | ||||
| > | k], http://fknxjhefhdak.com/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcl | ||||
| > | dqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeel | ||||
| > | euko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com/2qyQdJ <a href="http://s | ||||
| > | zqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/ | ||||
| > | url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.co | ||||
| > | m/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrth | ||||
| > | mvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/li | ||||
| > | nk], http://fknxjhefhdak.com/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphc | ||||
| > | ldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkee | ||||
| > | leuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.com/2qyQdJ <a href="http:// | ||||
| > | szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrthmvtzjcm.com/]rwrthmvtzjcm[ | ||||
| > | /url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/link], http://fknxjhefhdak.c | ||||
| > | om/2qyQdJ <a href="http://szqptphcldqe.com/">szqptphcldqe</a>, [url=http://rwrt | ||||
| > | hmvtzjcm.com/]rwrthmvtzjcm[/url], [link=http://pbvvkeeleuko.com/]pbvvkeeleuko[/l | ||||
| > | ink], http://fknxjhefhdak.com/ | ||||
| 2 | ============================== | ||||
| 3 | |||||
| 4 | **Are You stuck behind a firewall?** | ||||
| 5 | |||||
| 6 | Does your school, library, work, or parents control where you surf and what por | ||||
| > | ts you have open? Do you surf on such public domains and need more privacy? Are | ||||
| > | you sick of failing proxies? If you answered 'Y' to any of these questions then | ||||
| > | this tutorial is for you. | ||||
| 7 | |||||
| 8 | **My Story** | ||||
| 9 | |||||
| 10 | My place of employment has a bastard firewall and it blocks nearly all ports an | ||||
| > | d many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). I n | ||||
| > | eeded a way to get around the blocks and not get caught. | ||||
| 11 | |||||
| 12 | |||||
| 13 | |||||
| 14 | .. contents:: Sections | ||||
| 15 | |||||
| 16 | Common Questions | ||||
| 17 | ------------------- | ||||
| 18 | **What is the best way to get around a firewall?** | ||||
| 19 | |||||
| 20 | Create an SSH tunnel from the work network to your home network. | ||||
| 21 | |||||
| 22 | **My network administrator is smart, will I get caught?** | ||||
| 23 | |||||
| 24 | No, you will most likely not get caught. All the firewall sees is a connection | ||||
| > | to a resource on the internet. When you browse the web using the tunnel all tr | ||||
| > | affic is encrypted. If a network administrator captured packets he would only g | ||||
| > | et garbage data. An SSH tunnel is basically a VPN between two computers or netw | ||||
| > | orks. 1337 | ||||
| 25 | |||||
| 26 | **Can a network admin stop a person or computer from tunneling?** | ||||
| 27 | |||||
| 28 | The Admin will typically not know about the tunnel. From his view a tiny conne | ||||
| > | ction is being placed and is normally overlooked. The admin does have the abili | ||||
| > | ty to block the default SSH port 22. You can build your tunnel over any port. | ||||
| 29 | |||||
| 30 | Article Scope | ||||
| 31 | ------------------- | ||||
| 32 | |||||
| 33 | .. _Putty.exe: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | ||||
| 34 | .. _Firefox: http://portableapps.com/apps/internet/firefox_portable | ||||
| 35 | |||||
| 36 | We will discuss the steps of building an SSH Tunnel for HTTP traffic between two | ||||
| > | computers on different networks. This guide will cover both windows and linux | ||||
| > | localhosts. | ||||
| 37 | |||||
| 38 | Throughout this guide I will use the following terms, here are the definitions: | ||||
| 39 | |||||
| 40 | *localhost* | ||||
| 41 | The computer at work or school. | ||||
| 42 | *remotehost* | ||||
| 43 | The computer or server that is offsite, which has the SSH server running. | ||||
| 44 | |||||
| 45 | **What you need ...** | ||||
| 46 | |||||
| 47 | #. Credentials to a remotehost running an SSH server. (openssh-server) | ||||
| 48 | #. A localhost computer crippled by a pesky network firewall. | ||||
| 49 | #. An SSH client, For windows get Putty.exe_ | ||||
| 50 | #. Firefox_ ( Portable is best ) | ||||
| 51 | |||||
| 52 | **Why is this the best method?** | ||||
| 53 | |||||
| 54 | #. Most of the configuration is done from the localhost (while at school or work | ||||
| > | ). | ||||
| 55 | #. You don't need admin rights to run Putty.exe_, just place it on a USB drive. | ||||
| 56 | #. You don't need admin rights to run Firefox_ Portable, just place it on a USB | ||||
| > | drive. | ||||
| 57 | #. No changes need to be made on the remotehost ssh server. | ||||
| 58 | |||||
| 59 | |||||
| 60 | SSH Tunnel created from a Windows localhost | ||||
| 61 | ----------------------------------------------- | ||||
| 62 | |||||
| 63 | Follow this guide if your localhost (school or work) computer is Windows based. | ||||
| 64 | |||||
| 65 | Configure the SSH Server | ||||
| 66 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 67 | |||||
| 68 | The remotehost SSH server doesn't need to be configured. | ||||
| 69 | |||||
| 70 | Just be sure its installed and running and that you have credentials to login. I | ||||
| > | t just needs to be installed and running and you just need credentials. | ||||
| 71 | |||||
| 72 | To install openSSH-server on Debian or Ubuntu linux type: | ||||
| 73 | |||||
| 74 | .. code-block:: apache | ||||
| 75 | |||||
| 76 | sudo apt-get install ssh | ||||
| 77 | |||||
| 78 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. | ||||
| > | |||||
| 79 | |||||
| 80 | Keep in mind that this doesn't have to be your server, you just need credentials | ||||
| > | for SSH. | ||||
| 81 | |||||
| 82 | |||||
| 83 | Configure the SSH Client | ||||
| 84 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 85 | #. Download Putty.exe_ if you haven't already, you should follow along. | ||||
| 86 | |||||
| 87 | #. Double click Putty.exe_. | ||||
| 88 | |||||
| 89 | .. image:: http://engineer.siue.edu/puttyConnectScreen.gif | ||||
| 90 | |||||
| 91 | #. The 'Host Name (or IP address)' box should point to the SSH enabled remoteser | ||||
| > | ver. | ||||
| 92 | |||||
| 93 | #. Toggle the SSH radio button to set the port to 22. (The native SSH port). | ||||
| 94 | |||||
| 95 | #. Type a name into the 'Saved Sessions' box to save all the settings we toggle. | ||||
| 96 | |||||
| 97 | #. Click the save button. | ||||
| 98 | |||||
| 99 | #. There is a list of categories to the left of the putty window. | ||||
| 100 | |||||
| 101 | #. Navigate to: ( Connection > SSH > Tunnel ) | ||||
| 102 | |||||
| 103 | #. You should be at a menu that is labeled 'Options controlling SSH port forward | ||||
| > | ing'. | ||||
| 104 | |||||
| 105 | #. Click the 'Dynamic' radio button. | ||||
| 106 | |||||
| 107 | #. Leave 'Destination' text box blank. | ||||
| 108 | |||||
| 109 | #. Type '7070' into the 'Source port' text box. | ||||
| 110 | |||||
| 111 | #. Click the 'Add' button. | ||||
| 112 | |||||
| 113 | #. Save your configuration by going back to the 'Session' category, selecting yo | ||||
| > | ur saved session, and pressing the 'save' button. | ||||
| 114 | |||||
| 115 | #. Double-click your saved session. | ||||
| 116 | |||||
| 117 | #. A black terminal window should appear. | ||||
| 118 | |||||
| 119 | #. You will be prompted for a username and password. | ||||
| 120 | |||||
| 121 | #. You should be greeted by the server if successful. Leave the putty window op | ||||
| > | en. | ||||
| 122 | |||||
| 123 | #. `Configure Firefox... <#configure-firefox-to-use-the-ssh-tunnel>`_ | ||||
| 124 | |||||
| 125 | |||||
| 126 | SSH Tunnel created from a Linux localhost | ||||
| 127 | ------------------------------------------------ | ||||
| 128 | |||||
| 129 | Follow this guide if your localhost (work or school) computer is Linux. | ||||
| 130 | |||||
| 131 | Create the tunnel | ||||
| 132 | ~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 133 | |||||
| 134 | Open a terminal or console window, and enter the following command: | ||||
| 135 | |||||
| 136 | .. code-block:: bash | ||||
| 137 | |||||
| 138 | ssh -ND 7070 user@remotehost_ip | ||||
| 139 | |||||
| 140 | You will be prompted for credentials on the remotehost. | ||||
| 141 | |||||
| 142 | All you need to do is login to establish the tunnel. | ||||
| 143 | |||||
| 144 | |||||
| 145 | |||||
| 146 | Configure Firefox to use the SSH Tunnel | ||||
| 147 | ------------------------------------------ | ||||
| 148 | |||||
| 149 | Setup Socks 5 proxy. | ||||
| 150 | |||||
| 151 | #. Open Firefox_. | ||||
| 152 | |||||
| 153 | #. Click **Edit** -> **Preferences** | ||||
| 154 | |||||
| 155 | #. Click the **Advanced** and **Network** tabs. | ||||
| 156 | |||||
| 157 | #. Click the **Settings...** button. | ||||
| 158 | |||||
| 159 | #. Click the **Manual Proxy Configuration** radio button | ||||
| 160 | |||||
| 161 | #. In **Socks Host** type *localhost*. In port type *7070*. | ||||
| 162 | |||||
| 163 | .. image:: /attachment/ff-settings.jpg | ||||
| 164 | :align: left | ||||
| 165 | |||||
| 166 | You should now be able to browse the Internet using your remote connection. All | ||||
| > | data will be passed through the remote hosts internet connection. All traffic | ||||
| > | will be encrypted between the localhost and the remotehost. | ||||
| 167 | |||||
| 168 | |||||
| 169 | Tunnel to multiple vnc hosts behind a firewall | ||||
| 170 | ============================================================== | ||||
| 171 | |||||
| 172 | .. code-block:: bash | ||||
| 173 | |||||
| 174 | ssh -L <localport>:<remotehost>:<remoteport> <ssh-user>@<remote> | ||||
| 175 | |||||
| 176 | ssh -L 31337:remote.foxhop.net:5900 user@foxhop.net | ||||
| 177 | |||||
| 178 | ssh -L 31338:remote2.foxhop.net:5900 user@foxhop.net | ||||
| 179 | |||||
| 180 | Then open vnc and point to 127.0.0.1:31338 or 127.0.0.1:31337 | ||||
| rev 9 | rev 10 | ||||
|---|---|---|---|---|---|
| 170 | ============================================================== | 170 | ============================================================== | ||
| 171 | 171 | ||||
| n | 172 | ssh -L [localport]:remotehost:remoteport sshuser@sshserver | n | 172 | .. code-block:: bash |
| 173 | 173 | ||||
| n | 174 | ssh -L 31337:rhost1:5900 user@foxhop.net | n | 174 | ssh -L <localport>:<remotehost>:<remoteport> <ssh-user>@<remote> |
| 175 | 175 | ||||
| t | t | 176 | ssh -L 31337:remote.foxhop.net:5900 user@foxhop.net | ||
| 177 | |||||
| 176 | ssh -L 31338:rhost2:5900 user@foxhop.net | 178 | ssh -L 31338:remote2.foxhop.net:5900 user@foxhop.net | ||
| 179 | |||||
| 180 | Then open vnc and point to 127.0.0.1:31338 or 127.0.0.1:31337 | ||||
| rev 8 | rev 9 | ||||
|---|---|---|---|---|---|
| 161 | #. In **Socks Host** type *localhost*. In port type *7070*. | 161 | #. In **Socks Host** type *localhost*. In port type *7070*. | ||
| 162 | 162 | ||||
| t | t | 163 | .. image:: /attachment/ff-settings.jpg | ||
| 164 | :align: left | ||||
| 165 | |||||
| 163 | You should now be able to browse the Internet using your remote connection. All | 166 | You should now be able to browse the Internet using your remote connection. All | ||
| > | data will be passed through the remote hosts internet connection. All traffic | > | data will be passed through the remote hosts internet connection. All traffic | ||
| > | will be encrypted between the localhost and the remotehost. | > | will be encrypted between the localhost and the remotehost. | ||
| 164 | 167 | ||||
| rev 7 | rev 8 | ||||
|---|---|---|---|---|---|
| 134 | Open a terminal or console window, and enter the following command: | 134 | Open a terminal or console window, and enter the following command: | ||
| 135 | 135 | ||||
| t | 136 | ..code-block:: apache | t | 136 | .. code-block:: bash |
| 137 | 137 | ||||
| 138 | ssh -ND 7070 user@remotehost_ip | 138 | ssh -ND 7070 user@remotehost_ip | ||
| rev 6 | rev 7 | ||||
|---|---|---|---|---|---|
| 83 | Configure the SSH Client | 83 | Configure the SSH Client | ||
| 84 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 84 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| n | 85 | #. Download Putty.exe_ if you haven't already, you should follow along. | n | 85 | #. Download Putty.exe_ if you haven't already, you should follow along. |
| 86 | 86 | ||||
| n | 87 | #. Double click Putty.exe_. | n | 87 | #. Double click Putty.exe_. |
| 88 | 88 | ||||
| n | 89 | .. image:: http://engineer.siue.edu/puttyConnectScreen.gif | n | 89 | .. image:: http://engineer.siue.edu/puttyConnectScreen.gif |
| 90 | 90 | ||||
| n | 91 | #. The 'Host Name (or IP address)' box should point to the SSH enabled remotese | n | 91 | #. The 'Host Name (or IP address)' box should point to the SSH enabled remoteser |
| > | rver. | > | ver. | ||
| 92 | 92 | ||||
| n | 93 | #. Toggle the SSH radio button to set the port to 22. (The native SSH port). | n | 93 | #. Toggle the SSH radio button to set the port to 22. (The native SSH port). |
| 94 | 94 | ||||
| n | 95 | #. Type a name into the 'Saved Sessions' box to save all the settings we toggle | n | 95 | #. Type a name into the 'Saved Sessions' box to save all the settings we toggle. |
| > | . | ||||
| 96 | 96 | ||||
| n | 97 | #. Click the save button. | n | 97 | #. Click the save button. |
| 98 | 98 | ||||
| n | 99 | #. There is a list of categories to the left of the putty window. | n | 99 | #. There is a list of categories to the left of the putty window. |
| 100 | 100 | ||||
| n | 101 | #. Navigate to: ( Connection > SSH > Tunnel ) | n | 101 | #. Navigate to: ( Connection > SSH > Tunnel ) |
| 102 | 102 | ||||
| n | 103 | #. You should be at a menu that is labeled 'Options controlling SSH port forwar | n | 103 | #. You should be at a menu that is labeled 'Options controlling SSH port forward |
| > | ding'. | > | ing'. | ||
| 104 | 104 | ||||
| n | 105 | #. Click the 'Dynamic' radio button. | n | 105 | #. Click the 'Dynamic' radio button. |
| 106 | 106 | ||||
| n | 107 | #. Leave 'Destination' text box blank. | n | 107 | #. Leave 'Destination' text box blank. |
| 108 | 108 | ||||
| n | 109 | #. Type '7070' into the 'Source port' text box. | n | 109 | #. Type '7070' into the 'Source port' text box. |
| 110 | 110 | ||||
| n | 111 | #. Click the 'Add' button. | n | 111 | #. Click the 'Add' button. |
| 112 | 112 | ||||
| n | 113 | #. Save your configuration by going back to the 'Session' category, selecting y | n | 113 | #. Save your configuration by going back to the 'Session' category, selecting yo |
| > | our saved session, and pressing the 'save' button. | > | ur saved session, and pressing the 'save' button. | ||
| 114 | 114 | ||||
| n | 115 | #. Double-click your saved session. | n | 115 | #. Double-click your saved session. |
| 116 | 116 | ||||
| n | 117 | #. A black terminal window should appear. | n | 117 | #. A black terminal window should appear. |
| 118 | 118 | ||||
| n | 119 | #. You will be prompted for a username and password. | n | 119 | #. You will be prompted for a username and password. |
| 120 | 120 | ||||
| n | 121 | #. You should be greeted by the server if successful. Leave the putty window o | n | 121 | #. You should be greeted by the server if successful. Leave the putty window op |
| > | pen. | > | en. | ||
| 122 | 122 | ||||
| n | 123 | #. `Configure Firefox... <#configure-firefox-to-use-the-ssh-tunnel>`_ | n | 123 | #. `Configure Firefox... <#configure-firefox-to-use-the-ssh-tunnel>`_ |
| 124 | 124 | ||||
| 125 | 125 | ||||
| 127 | ------------------------------------------------ | 127 | ------------------------------------------------ | ||
| 128 | 128 | ||||
| n | 129 | Follow this guide if your localhost (work or school) computer is Linux. | n | 129 | Follow this guide if your localhost (work or school) computer is Linux. |
| 130 | 130 | ||||
| 131 | Create the tunnel | 131 | Create the tunnel | ||
| 132 | ~~~~~~~~~~~~~~~~~~~~~~ | 132 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
| 133 | 133 | ||||
| t | 134 | Open a terminal or console window, and enter the following command:: | t | 134 | Open a terminal or console window, and enter the following command: |
| 135 | |||||
| 136 | ..code-block:: apache | ||||
| 135 | 137 | ||||
| 136 | ssh -ND 7070 user@remotehost_ip | 138 | ssh -ND 7070 user@remotehost_ip | ||
| rev 5 | rev 6 | ||||
|---|---|---|---|---|---|
| 4 | **Are You stuck behind a firewall?** | 4 | **Are You stuck behind a firewall?** | ||
| 5 | 5 | ||||
| n | 6 | Does your school, library, work, or parents control where you surf and what por | n | 6 | Does your school, library, work, or parents control where you surf and what por |
| > | ts you have open? Do you surf on such public domains and need more privacy? Are | > | ts you have open? Do you surf on such public domains and need more privacy? Are | ||
| > | you sick of failing proxies? | > | you sick of failing proxies? If you answered 'Y' to any of these questions then | ||
| > | this tutorial is for you. | ||||
| 7 | |||||
| 8 | If you answered 'Y' to any of these questions then this tutorial is for you. | ||||
| 9 | 7 | ||||
| 10 | **My Story** | 8 | **My Story** | ||
| 63 | ----------------------------------------------- | 61 | ----------------------------------------------- | ||
| 64 | 62 | ||||
| n | 65 | Follow this guide if your localhost (school or work) computer is Windows based. | n | 63 | Follow this guide if your localhost (school or work) computer is Windows based. |
| 66 | 64 | ||||
| 67 | Configure the SSH Server | 65 | Configure the SSH Server | ||
| 72 | Just be sure its installed and running and that you have credentials to login. I | 70 | Just be sure its installed and running and that you have credentials to login. I | ||
| > | t just needs to be installed and running and you just need credentials. | > | t just needs to be installed and running and you just need credentials. | ||
| 73 | 71 | ||||
| n | 74 | To install openSSH-server on Debian or Ubuntu linux type:: | n | 72 | To install openSSH-server on Debian or Ubuntu linux type: |
| 75 | 73 | ||||
| t | 76 | .. code-block:: python | t | 74 | .. code-block:: apache |
| 77 | 75 | ||||
| 78 | sudo apt-get install ssh | 76 | sudo apt-get install ssh | ||
| rev 4 | rev 5 | ||||
|---|---|---|---|---|---|
| 11 | 11 | ||||
| 12 | My place of employment has a bastard firewall and it blocks nearly all ports an | 12 | My place of employment has a bastard firewall and it blocks nearly all ports an | ||
| > | d many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). I n | > | d many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). I n | ||
| > | eeded a way to get around the blocks and not get caught. | > | eeded a way to get around the blocks and not get caught. | ||
| t | t | 13 | |||
| 13 | 14 | ||||
| 14 | 15 | ||||
| rev 3 | rev 4 | ||||
|---|---|---|---|---|---|
| 66 | Configure the SSH Server | 66 | Configure the SSH Server | ||
| 67 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 67 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| n | 68 | The remotehost SSH server doesn't need to be configured. | n | ||
| 69 | 68 | ||||
| n | 70 | Just be sure its installed and running and that you have credentials to login. | n | 69 | The remotehost SSH server doesn't need to be configured. |
| > | It just needs to be installed and running and you just need credentials. | ||||
| 71 | 70 | ||||
| n | 72 | To install openSSH-server on Debian or Ubuntu linux type:: | n | 71 | Just be sure its installed and running and that you have credentials to login. I |
| > | t just needs to be installed and running and you just need credentials. | ||||
| 73 | 72 | ||||
| n | n | 73 | To install openSSH-server on Debian or Ubuntu linux type:: | ||
| 74 | |||||
| 75 | .. code-block:: python | ||||
| 76 | |||||
| 74 | sudo apt-get install ssh | 77 | sudo apt-get install ssh | ||
| 75 | 78 | ||||
| n | 76 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. | n | 79 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. |
| > | > | ||||
| 77 | 80 | ||||
| t | 78 | Keep in mind that this doesn't have to be your server, you just need credential | t | 81 | Keep in mind that this doesn't have to be your server, you just need credentials |
| > | s for SSH. | > | for SSH. | ||
| 79 | 82 | ||||
| 80 | 83 | ||||
| rev 2 | rev 3 | ||||
|---|---|---|---|---|---|
| 165 | ssh -L [localport]:remotehost:remoteport sshuser@sshserver | 165 | ssh -L [localport]:remotehost:remoteport sshuser@sshserver | ||
| 166 | 166 | ||||
| t | 167 | ssh -L 31337:ryu:5900 user@foxhop.net | t | 167 | ssh -L 31337:rhost1:5900 user@foxhop.net |
| 168 | |||||
| 169 | ssh -L 31338:rhost2:5900 user@foxhop.net | ||||
| rev 1 | rev 2 | ||||
|---|---|---|---|---|---|
| 139 | 139 | ||||
| 140 | 140 | ||||
| n | n | 141 | |||
| 141 | Configure Firefox to use the SSH Tunnel | 142 | Configure Firefox to use the SSH Tunnel | ||
| 142 | ------------------------------------------ | 143 | ------------------------------------------ | ||
| 157 | 158 | ||||
| 158 | You should now be able to browse the Internet using your remote connection. All | 159 | You should now be able to browse the Internet using your remote connection. All | ||
| > | data will be passed through the remote hosts internet connection. All traffic | > | data will be passed through the remote hosts internet connection. All traffic | ||
| > | will be encrypted between the localhost and the remotehost. | > | will be encrypted between the localhost and the remotehost. | ||
| t | t | 160 | |||
| 161 | |||||
| 162 | Tunnel to multiple vnc hosts behind a firewall | ||||
| 163 | ============================================================== | ||||
| 164 | |||||
| 165 | ssh -L [localport]:remotehost:remoteport sshuser@sshserver | ||||
| 166 | |||||
| 167 | ssh -L 31337:ryu:5900 user@foxhop.net | ||||
| empty | rev 1 | ||||
|---|---|---|---|---|---|
| t | t | 1 | SSH Tunnel for HTTP Traffic | ||
| 2 | ============================== | ||||
| 3 | |||||
| 4 | **Are You stuck behind a firewall?** | ||||
| 5 | |||||
| 6 | Does your school, library, work, or parents control where you surf and what por | ||||
| > | ts you have open? Do you surf on such public domains and need more privacy? Are | ||||
| > | you sick of failing proxies? | ||||
| 7 | |||||
| 8 | If you answered 'Y' to any of these questions then this tutorial is for you. | ||||
| 9 | |||||
| 10 | **My Story** | ||||
| 11 | |||||
| 12 | My place of employment has a bastard firewall and it blocks nearly all ports an | ||||
| > | d many great sites. (such as foxhop.net, icodeviruses.com, or youtube.com). I n | ||||
| > | eeded a way to get around the blocks and not get caught. | ||||
| 13 | |||||
| 14 | |||||
| 15 | .. contents:: Sections | ||||
| 16 | |||||
| 17 | Common Questions | ||||
| 18 | ------------------- | ||||
| 19 | **What is the best way to get around a firewall?** | ||||
| 20 | |||||
| 21 | Create an SSH tunnel from the work network to your home network. | ||||
| 22 | |||||
| 23 | **My network administrator is smart, will I get caught?** | ||||
| 24 | |||||
| 25 | No, you will most likely not get caught. All the firewall sees is a connection | ||||
| > | to a resource on the internet. When you browse the web using the tunnel all tr | ||||
| > | affic is encrypted. If a network administrator captured packets he would only g | ||||
| > | et garbage data. An SSH tunnel is basically a VPN between two computers or netw | ||||
| > | orks. 1337 | ||||
| 26 | |||||
| 27 | **Can a network admin stop a person or computer from tunneling?** | ||||
| 28 | |||||
| 29 | The Admin will typically not know about the tunnel. From his view a tiny conne | ||||
| > | ction is being placed and is normally overlooked. The admin does have the abili | ||||
| > | ty to block the default SSH port 22. You can build your tunnel over any port. | ||||
| 30 | |||||
| 31 | Article Scope | ||||
| 32 | ------------------- | ||||
| 33 | |||||
| 34 | .. _Putty.exe: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | ||||
| 35 | .. _Firefox: http://portableapps.com/apps/internet/firefox_portable | ||||
| 36 | |||||
| 37 | We will discuss the steps of building an SSH Tunnel for HTTP traffic between two | ||||
| > | computers on different networks. This guide will cover both windows and linux | ||||
| > | localhosts. | ||||
| 38 | |||||
| 39 | Throughout this guide I will use the following terms, here are the definitions: | ||||
| 40 | |||||
| 41 | *localhost* | ||||
| 42 | The computer at work or school. | ||||
| 43 | *remotehost* | ||||
| 44 | The computer or server that is offsite, which has the SSH server running. | ||||
| 45 | |||||
| 46 | **What you need ...** | ||||
| 47 | |||||
| 48 | #. Credentials to a remotehost running an SSH server. (openssh-server) | ||||
| 49 | #. A localhost computer crippled by a pesky network firewall. | ||||
| 50 | #. An SSH client, For windows get Putty.exe_ | ||||
| 51 | #. Firefox_ ( Portable is best ) | ||||
| 52 | |||||
| 53 | **Why is this the best method?** | ||||
| 54 | |||||
| 55 | #. Most of the configuration is done from the localhost (while at school or work | ||||
| > | ). | ||||
| 56 | #. You don't need admin rights to run Putty.exe_, just place it on a USB drive. | ||||
| 57 | #. You don't need admin rights to run Firefox_ Portable, just place it on a USB | ||||
| > | drive. | ||||
| 58 | #. No changes need to be made on the remotehost ssh server. | ||||
| 59 | |||||
| 60 | |||||
| 61 | SSH Tunnel created from a Windows localhost | ||||
| 62 | ----------------------------------------------- | ||||
| 63 | |||||
| 64 | Follow this guide if your localhost (school or work) computer is Windows based. | ||||
| 65 | |||||
| 66 | Configure the SSH Server | ||||
| 67 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 68 | The remotehost SSH server doesn't need to be configured. | ||||
| 69 | |||||
| 70 | Just be sure its installed and running and that you have credentials to login. | ||||
| > | It just needs to be installed and running and you just need credentials. | ||||
| 71 | |||||
| 72 | To install openSSH-server on Debian or Ubuntu linux type:: | ||||
| 73 | |||||
| 74 | sudo apt-get install ssh | ||||
| 75 | |||||
| 76 | When I'm at work, I establish an SSH Tunnel to my remotehost webserver at home. | ||||
| > | |||||
| 77 | |||||
| 78 | Keep in mind that this doesn't have to be your server, you just need credential | ||||
| > | s for SSH. | ||||
| 79 | |||||
| 80 | |||||
| 81 | Configure the SSH Client | ||||
| 82 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 83 | #. Download Putty.exe_ if you haven't already, you should follow along. | ||||
| 84 | |||||
| 85 | #. Double click Putty.exe_. | ||||
| 86 | |||||
| 87 | .. image:: http://engineer.siue.edu/puttyConnectScreen.gif | ||||
| 88 | |||||
| 89 | #. The 'Host Name (or IP address)' box should point to the SSH enabled remotese | ||||
| > | rver. | ||||
| 90 | |||||
| 91 | #. Toggle the SSH radio button to set the port to 22. (The native SSH port). | ||||
| 92 | |||||
| 93 | #. Type a name into the 'Saved Sessions' box to save all the settings we toggle | ||||
| > | . | ||||
| 94 | |||||
| 95 | #. Click the save button. | ||||
| 96 | |||||
| 97 | #. There is a list of categories to the left of the putty window. | ||||
| 98 | |||||
| 99 | #. Navigate to: ( Connection > SSH > Tunnel ) | ||||
| 100 | |||||
| 101 | #. You should be at a menu that is labeled 'Options controlling SSH port forwar | ||||
| > | ding'. | ||||
| 102 | |||||
| 103 | #. Click the 'Dynamic' radio button. | ||||
| 104 | |||||
| 105 | #. Leave 'Destination' text box blank. | ||||
| 106 | |||||
| 107 | #. Type '7070' into the 'Source port' text box. | ||||
| 108 | |||||
| 109 | #. Click the 'Add' button. | ||||
| 110 | |||||
| 111 | #. Save your configuration by going back to the 'Session' category, selecting y | ||||
| > | our saved session, and pressing the 'save' button. | ||||
| 112 | |||||
| 113 | #. Double-click your saved session. | ||||
| 114 | |||||
| 115 | #. A black terminal window should appear. | ||||
| 116 | |||||
| 117 | #. You will be prompted for a username and password. | ||||
| 118 | |||||
| 119 | #. You should be greeted by the server if successful. Leave the putty window o | ||||
| > | pen. | ||||
| 120 | |||||
| 121 | #. `Configure Firefox... <#configure-firefox-to-use-the-ssh-tunnel>`_ | ||||
| 122 | |||||
| 123 | |||||
| 124 | SSH Tunnel created from a Linux localhost | ||||
| 125 | ------------------------------------------------ | ||||
| 126 | |||||
| 127 | Follow this guide if your localhost (work or school) computer is Linux. | ||||
| 128 | |||||
| 129 | Create the tunnel | ||||
| 130 | ~~~~~~~~~~~~~~~~~~~~~~ | ||||
| 131 | |||||
| 132 | Open a terminal or console window, and enter the following command:: | ||||
| 133 | |||||
| 134 | ssh -ND 7070 user@remotehost_ip | ||||
| 135 | |||||
| 136 | You will be prompted for credentials on the remotehost. | ||||
| 137 | |||||
| 138 | All you need to do is login to establish the tunnel. | ||||
| 139 | |||||
| 140 | |||||
| 141 | Configure Firefox to use the SSH Tunnel | ||||
| 142 | ------------------------------------------ | ||||
| 143 | |||||
| 144 | Setup Socks 5 proxy. | ||||
| 145 | |||||
| 146 | #. Open Firefox_. | ||||
| 147 | |||||
| 148 | #. Click **Edit** -> **Preferences** | ||||
| 149 | |||||
| 150 | #. Click the **Advanced** and **Network** tabs. | ||||
| 151 | |||||
| 152 | #. Click the **Settings...** button. | ||||
| 153 | |||||
| 154 | #. Click the **Manual Proxy Configuration** radio button | ||||
| 155 | |||||
| 156 | #. In **Socks Host** type *localhost*. In port type *7070*. | ||||
| 157 | |||||
| 158 | You should now be able to browse the Internet using your remote connection. All | ||||
| > | data will be passed through the remote hosts internet connection. All traffic | ||||
| > | will be encrypted between the localhost and the remotehost. | ||||
Remarkbox