{"id":26,"date":"2013-08-13T00:06:55","date_gmt":"2013-08-13T00:06:55","guid":{"rendered":"http:\/\/www.colemanworld.net\/?p=26"},"modified":"2020-06-04T20:53:36","modified_gmt":"2020-06-04T20:53:36","slug":"tunnel","status":"publish","type":"post","link":"https:\/\/www.colemanworld.net\/?p=26","title":{"rendered":"Tunnel"},"content":{"rendered":"<p>SSH Tunneling Tutorial: A guide by Stickyboot<br \/>\n<sup>Because sometimes you need to rout traffic through servers<\/sup><br \/>\n<img decoding=\"async\" src=\"http:\/\/i.imgur.com\/iwuFy3m.png\" alt=\"Terminal\" \/><br \/>\nOpening, and subsequently routing data through an SSH tunnel is a very useful trick to know about.\u00a0 I like to think of a tunnel like this:\u00a0 When you open a tunnel, and direct programs to connect to the internet through the tunnel, it&#8217;s as if that program is talking to the internet at the point where your server connects to the internet.\u00a0 All your ISP\/Network provider will see is encrypted traffic to and from your server with respect to the programs you configure to connect through that tunnel.<\/p>\n<p>There are a number of uses for this:<\/p>\n<ul>\n<li>Logging into websites using a servers IP address (Good for registering server IP address with sites like this)<\/li>\n<li>Getting around network level internet filtering (you naughty high school students you!)<\/li>\n<li>Preventing exposure of certain IP&#8217;s and domain names while using untrustworthy networks<\/li>\n<li>Getting around region based filtering (IE watch your Netflix off your US based server while overseas\/out of country)<\/li>\n<\/ul>\n<p>This tutorial assumes you have SSH access to a server.\u00a0 This is most likely through your VPS that you rent from a community member here, a seedbox, a website you pay for hosting on, a free terminal access server etc.\u00a0 Always be aware of the restrictions and rules the server operators have on the server you intend to use.\u00a0 Also adhere to the community guidelines when it comes to connecting to private site such as this (meaning, make sure you trust the connection you are on, and the connection the server is on, as in don&#8217;t connect to private places through public servers).<\/p>\n<h2 id=\"\"><strong>Windows<\/strong><\/h2>\n<div id=\"dc0667e35657dd0fd3497ae2c99e7e28\"><strong>Step 1: Download PuTTY<\/strong><br \/>\n<a href=\"https:\/\/the.earth.li\/~sgtatham\/putty\/latest\/x86\/putty.exe\">Download PuTTY<\/a>\u00a0from the\u00a0<a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">official website<\/a>.\u00a0 Put it where you put your program files (Like C:\\Program Files (x86)\\PuTTY).\u00a0 Also make a start menu shortcut for convenience.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/Z9pU4Gf.png\" alt=\"Step 1\" \/><strong>Step 2: Configure and save a session<\/strong><br \/>\nWe now need to set up a session in putty and save it for future convince.\u00a0 A session is basically like a configuration profile that lets you quickly recall settings for connecting to different servers.&nbsp;<\/p>\n<blockquote><p><strong>2.1<\/strong>\u00a0 Launch PuTTY.\u00a0 You will see the following screen.\u00a0 Start by entering the server IP or domain name into the Host Name box.\u00a0 Also use the correct port, but 22 usually works by default.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/t8ET6VK.png\" alt=\"Step 2.1\" \/><\/p><\/blockquote>\n<blockquote><p><strong>2.2<\/strong>\u00a0 Next, go to the Connection-&gt;Data tab in the sidebar.\u00a0 Enter the user name of the account you plan on connecting with.\u00a0 This is purely for convenience.\u00a0 If you do not do this, you will be prompted for a user name when connecting to the server.\u00a0 If you are paranoid about someone finding out your user name you might want to leave this blank.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/PQiiQVa.png\" alt=\"Step 2.2\" \/><\/p><\/blockquote>\n<blockquote><p><strong>2.3<\/strong>\u00a0 Now define a local port to allow programs to tunnel through.\u00a0 Go to the Connection-&gt;SHH-&gt;Tunnels section in the sidebar.\u00a0 Add an unused local port, choose dynamic, and leave it on auto then press add.\u00a0 I use port 7777, but any unused port will work.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/Tylmo7C.png\" alt=\"Step 2.3\" \/><\/p><\/blockquote>\n<blockquote><p><strong>2.4<\/strong>\u00a0 You should now see the port number followed by a D (for dynamic) in your forwarded ports list.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/tzjL5iS.png\" alt=\"Step 2.4\" \/><\/p><\/blockquote>\n<blockquote><p><strong>2.5<\/strong>\u00a0 We are all done.\u00a0 We now need to save the session.\u00a0 Go back to the sessions section, type in a name for the session and press save.\u00a0 To reload a session in the future, select it from this list and press load.\u00a0 I like to indicate any tunneling settings into the session name so I would have probably called this session &#8220;testsession -7777D&#8221; to let me know that this session opens a dynamic tunnel on port 7777.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/Ow2w264.png\" alt=\"Step 2.5\" \/><\/p><\/blockquote>\n<blockquote><p><strong>2.6<\/strong>\u00a0 The sessions list should look something like this now:<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/wLBxrMs.png\" alt=\"Step 2.6\" \/><\/p><\/blockquote>\n<p><strong>Step 3: Open your tunnel<\/strong><br \/>\nNow press open in PuTTY after you did step 2, or loaded a session.\u00a0 Log in as normal, and leave the terminal session window open in the background.\u00a0 Your tunnel will remain open as long as your PuTTY session is open (so, as long as your window is open).<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/1wEgsXK.png\" alt=\"Step 3\" \/><\/p>\n<p><strong>Step 4: Route traffic through the tunnel<\/strong><br \/>\nThe tunnel is open, but you have to rout traffic through the tunnel for it to do anything useful.\u00a0 A common use of a tunnel is to run your browser through your tunnel so you can register the servers IP at websites by logging into them through a browser running through your server.\u00a0 The following steps explain how to rout Firefox through the tunnel.<\/p>\n<blockquote><p><strong>4.1<\/strong>\u00a0Launch Firefox.\u00a0 Open options. Go to the Advanced tab, then the network subtab and open the connections settings window.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/GsDOYJx.png\" alt=\"Step 4.1\" \/><\/p><\/blockquote>\n<blockquote><p><strong>4.2<\/strong>\u00a0Set to &#8220;Manual proxy configuration&#8221;.\u00a0 Enter &#8220;localhost&#8221; into the SOCKS Host box, and set the port to whatever port you used for your SSH tunnel.\u00a0 In this case, I used port 7777.\u00a0 Press okay and close preferences.\u00a0 When you want to close the tunnel, you will have to set this back to no proxy since your browser will not work in this mode without the tunnel running in the background.<br \/>\n<img decoding=\"async\" src=\"http:\/\/imgur.com\/PhL8fGd.png\" alt=\"Step 4.2\" \/><\/p><\/blockquote>\n<blockquote><p><strong>4.3\u00a0<\/strong>This step is required if you want to run absolutely all your traffic through your tunnel.\u00a0 I guess by defualt, firefox does not rout DNS lookups through the proxy settings, but this makes sure it does.\u00a0 This step is required if you want to hide your traffic from the network you access the internet on to the point of your server.\u00a0 If you just want to register your servers IP on a website, you do not need perform this step.<\/p>\n<blockquote>\n<h4>imantor said:<\/h4>\n<p>Configure Firefox to use the Tunnel also for DNS:<\/p>\n<p>To prevent Firefox from doing NS lookups enter about:config in the URL text field and double click on the network.proxy.socks_remote_dns to set it to true.<\/p><\/blockquote>\n<\/blockquote>\n<p>You are now routing all of Firefox&#8217;s traffic through your SSH tunnel.\u00a0 Congrats!\u00a0 You can use this in a number of other applications, but its the same process so go at it!\u00a0 Just don&#8217;t piss off your server admin by running all of your torrent traffic through their connection.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SSH Tunneling Tutorial: A guide by Stickyboot Because sometimes you need to rout traffic through servers Opening, and subsequently routing data through an SSH tunnel is a very useful trick to know about.\u00a0 I like to think of a tunnel like this:\u00a0 When you open a tunnel, and direct programs to connect to the internet [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":313,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","entry","has-media"],"_links":{"self":[{"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":6,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":315,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions\/315"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=\/wp\/v2\/media\/313"}],"wp:attachment":[{"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.colemanworld.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}