<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The HyRax Macrocosm &#187; Encryption</title>
	<atom:link href="http://www.serenux.com/tag/encryption/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serenux.com</link>
	<description>Life, the Universe and Ubuntu.</description>
	<lastBuildDate>Tue, 10 Jan 2012 06:59:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HowTo: Create and manage SSH tunnels using Gnome SSH Tunnel Manager</title>
		<link>http://www.serenux.com/2009/01/howto-create-and-manage-ssh-tunnels-using-gnome-ssh-tunnel-manager/</link>
		<comments>http://www.serenux.com/2009/01/howto-create-and-manage-ssh-tunnels-using-gnome-ssh-tunnel-manager/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 11:58:03 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[tunneling]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=331</guid>
		<description><![CDATA[The Secure SHell, or SSH, is a simple but effective tool for encrypted remote login to a Linux-based workstation or server. Not only does it give you secure command-line access to the remote PC, but it can also be used to securely redirect data to be routed or processed on the remote PC&#8217;s LAN such [...]]]></description>
			<content:encoded><![CDATA[<p>The Secure SHell, or SSH, is a simple but effective tool for encrypted remote login to a Linux-based workstation or server. Not only does it give you secure command-line access to the remote PC, but it can also be used to securely redirect data to be routed or processed on the remote PC&#8217;s LAN such as HTTP traffic or perhaps another protocol such as Jabber that is blocked on your local Internet connection. This process is called <em>tunneling</em>.</p>
<p>Creating an SSH tunnel is easy. Say you wanted to forward the local port 2100 to a web server inside your remote network on IP 192.168.0.99. The public hostname of the SSH server you are using to connect to is myserver.com. You can issue the command:</p>
<pre><span style="color: #000080;">$ ssh jbloggs@myserver.com -L 2100:192.168.0.99:80 -N</span></pre>
<p>&#8230;this will redirect local port 2100 to port 80 on the server with LAN IP 192.168.0.99 on the remote network, via the Internet-accessible SSH server on myserver.com, logging into it as the user jbloggs. Everytime you now access http://localhost:2100 with your web browser, your traffic will be redirected to the remote web server, using an encrypted tunnel over the Internet.</p>
<p>Now this is great, but that command line looks a bit convoluted. Isn&#8217;t there a more intuitive way to create an SSH tunnel?</p>
<p>There sure is &#8211; a neat little Gnome GUI app called the <strong>Gnome SSH Tunnel Manager</strong> or <strong>gSTM</strong> for short.</p>
<p><span id="more-331"></span>Here&#8217;s a diagram to illustrate what we are trying to do.</p>
<p><img class="aligncenter size-full wp-image-342" title="SSH Remote LAN server topology" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmsshtopology.jpg" alt="SSH Remote LAN server topology" width="532" height="382" /><br />
The Internal LAN web server cannot be accessed from the Internet, only local LAN users. For the workstation on the other side of the Internet to be able to access the LAN web server at 192.168.0.99, we need to tunnel into the SSH server and then pass through it to get to the Internal LAN web server.</p>
<p>First up, we need to install gSTM. It exists in the Ubuntu repository, so all you have to do is enter:</p>
<pre><span style="color: #000080;">$ sudo apt-get install gstm</span></pre>
<p>Once installed, you will find it in the <em>Applications-&gt;Internet-&gt;gSTM</em> menu. When you fire it up, you will be presented with the following window (in this case I&#8217;ve already setup three tunnels &#8211; your list will be empty):</p>
<p><img class="aligncenter size-full wp-image-332" title="gSTM Main Window" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmmaininterface.jpg" alt="gSTM Main Window" width="408" height="489" /></p>
<p>The list shows all the tunnels you have created to various locations. Each tunnel can have multiple ports directed over it. The green light next to the tunnel name indicates an active tunnel. A red light indicates an inactive tunnel.</p>
<ol>
<li>Creating a new tunnel is simplicity itself &#8211; just click on the Add button. A new window appears.
<p><img class="aligncenter size-full wp-image-333" title="gSTM Tunnel Settings" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmtunnelsettings.jpg" alt="gSTM Tunnel Settings" width="620" height="511" /><br />
.</li>
<li>In this window, we specify an arbitrary name for the tunnel, then the SSH server we&#8217;re connecting to, eg: myserver.com in the previous example (or its public IP address), the login name used to access that SSH server, eg: jbloggs, and the port that the remote SSH server is listening to (which by default is 22, but you may have changed it to a non-standard port number above 1000 for greater security).<br />
.</li>
<li>These are the only values you need to fill in to establish the basic tunnel. Next, we need to specify which ports we are going to redirect into that tunnel. Click on the &#8220;Add&#8221; button to add a new port.
<p><img class="aligncenter size-full wp-image-334" title="gSTM Add Redirection" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmaddredirection.jpg" alt="gSTM Add Redirection" width="492" height="144" /><br />
First we specify where the port we&#8217;re redirecting is coming from. &#8220;Local&#8221; means that we&#8217;re redirecting a port from the PC you are working on, to the remote PC. In the above example, we are going to redirect an arbitrary port number 32456 to port 80 on the PC 192.168.0.99 on the remote network&#8217;s internal LAN (via the remote SSH server). Click OK and then click OK on the previous window to save your Tunnel settings. It now appears in the list of available tunnels.<br />
.</li>
<li>Simply click on the Start button and you will be prompted for the password for the account you specified for the tunnel to access the remote SSH server with. Type it in and hit Enter.
<p><img class="aligncenter size-full wp-image-351" title="gSTM Password Prompt" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmpasswordprompt.jpg" alt="gSTM Password Prompt" width="356" height="141" />.</li>
<li>Once the green light appears next to your tunnel name in the list, you are ready to go. Open your web browser and type in http://localhost:32456 and you will suddenly see the web page of the internal machine on the remote network.<br />
.</li>
</ol>
<p>That&#8217;s pretty cool, but let&#8217;s try something even cooler. Stop your tunnel by clicking on the Stop button, then bring up the Properties for it again.</p>
<p>Let&#8217;s say you are at an office or school where the local Internet web access is filtered. There is a website that you&#8217;d like to visit, but it is blocked by the local organisation&#8217;s filter. Assuming outbound SSH access is allowed, you can effectively bypass the filter by routing all your web traffic via your remote SSH server whose web access is unfiltered. Here&#8217;s a diagram to illustrate what we&#8217;re doing:</p>
<p><img class="aligncenter size-full wp-image-343" title="Bypassing a local web filter by ussing an SSH tunnel topology" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmsshblockedsitebypasstopology.jpg" alt="Bypassing a local web filter by ussing an SSH tunnel topology" width="516" height="390" />The workstation tries to access the blocked website (indicated by the red line) but fails. By using an SSH tunnel (the green line), we can access the blocked website via the remote SSH server.</p>
<ol>
<li>To do this, add a redirection but change &#8220;Local&#8221; to be &#8220;Dynamic&#8221;, and specify an arbitrary port number, eg: 9100. You will notice that you cannot specify a To host or To port. Click OK.
<p><img class="aligncenter size-full wp-image-335" title="gSTM Add Dynamic Redirection" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmadddynamicredirection.jpg" alt="gSTM Add Dynamic Redirection" width="492" height="144" /><br />
.</li>
<li>Now open up your web browser and bring up the Proxy settings. In Firefox, this is located by going to the <em>Edit-&gt;Preferences</em> menu, then click on the <em>Advanced</em> icon, then the <em>Network</em> tab, then finally click on the <em>Settings</em> button. You are presented with the following window:
<p><img class="aligncenter size-full wp-image-336" title="Firefox's Default Proxy Settings" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmfirefoxproxysettingsdefault.jpg" alt="Firefox's Default Proxy Settings" width="502" height="541" /><br />
.</li>
<li>Change the radio selection at the top of the window to <em>Manual proxy configuration</em> and then in the SOCKS Host box ONLY, specify &#8220;localhost&#8221; and port &#8220;9100&#8243;.
<p><img class="aligncenter size-full wp-image-337" title="Firefox's Proxy Settings Modified" src="http://www.serenux.com/wp-content/uploads/2009/01/gstmfirefoxproxysettingsmodified.jpg" alt="Firefox's Proxy Settings Modified" width="502" height="541" /><br />
.</li>
<li>Now click OK and then close the Firefox preferences window.<br />
.</li>
<li>Start your SSH tunnel again by clicking on the Start button.<br />
.</li>
<li>Now try surfing to your blocked website. Instead of it being filtered, you will now find it magically appears because your web traffic is being proxied to your SSH tunnel and retrieved through your unfiltered remote Internet connection!<br />
.</li>
<li>When you are done, don&#8217;t forget to shutdown your SSH tunnel and change your web browser&#8217;s proxy settings back to whatever they were previously.<br />
.</li>
</ol>
<p>Happy tunneling! <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/01/howto-create-and-manage-ssh-tunnels-using-gnome-ssh-tunnel-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

