<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.ledhed.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.ledhed.net/index.php?action=history&amp;feed=atom&amp;title=Stunnels</id>
		<title>Stunnels - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.ledhed.net/index.php?action=history&amp;feed=atom&amp;title=Stunnels"/>
		<link rel="alternate" type="text/html" href="https://wiki.ledhed.net/index.php?title=Stunnels&amp;action=history"/>
		<updated>2026-05-12T18:09:20Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.2</generator>

	<entry>
		<id>//wiki.ledhed.net/index.php?title=Stunnels&amp;diff=2654&amp;oldid=prev</id>
		<title>Ledhed: Created page with 'Secure Tunnels or &quot;stunnels&quot; as they are commonly referred to are an amazing feature of SSH. They allow you to perform port redirection through an encrypted tunnel between hosts....'</title>
		<link rel="alternate" type="text/html" href="https://wiki.ledhed.net/index.php?title=Stunnels&amp;diff=2654&amp;oldid=prev"/>
				<updated>2012-07-04T19:17:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;Secure Tunnels or &amp;quot;stunnels&amp;quot; as they are commonly referred to are an amazing feature of SSH. They allow you to perform port redirection through an encrypted tunnel between hosts....&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Secure Tunnels or &amp;quot;stunnels&amp;quot; as they are commonly referred to are an amazing feature of SSH.&lt;br /&gt;
They allow you to perform port redirection through an encrypted tunnel between hosts.&lt;br /&gt;
Think of it as an application specific VPN.&lt;br /&gt;
&lt;br /&gt;
Possible Uses:&lt;br /&gt;
* Remote Desktop to a PC behind a firewall.&lt;br /&gt;
* Bypass my employers Proxy server, by forcing all my HTTP traffic through my home firewall (and its all encrypted).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Linux / BSD ==&lt;br /&gt;
This example can be used to connect to a remote proxy server.&lt;br /&gt;
&lt;br /&gt;
 ssh -f -N -L 8080:&amp;lt;remote_host.in&amp;gt;:3128 &amp;lt;user@remote_host.out&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explaination:&lt;br /&gt;
 8080                 = Local listening port&lt;br /&gt;
 &amp;lt;remote_host.in&amp;gt;     = The IP or Hostname of the SSH server you will be connecting to (in most cases this will be the Inside/Private Interface).&lt;br /&gt;
 3128                 = The remote hosts listening port (in this case its squid's default listening port).&lt;br /&gt;
 user@remote_host.out = The IP or Hostname of the SSH server you will be connecting to (in most cases this will be the Outside/Public Interface).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
We will use the same example as above, only for windows we will use [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] to establish the connection.&lt;br /&gt;
&lt;br /&gt;
'''Setup the Secure Tunnel'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Putty-stunnel.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Connecting to the Remote SSH Server'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Putty-connect.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RDP behind Firewall ==&lt;br /&gt;
Here is an example of how to use a stunnel to connect to a remote PC behind a firewall (assuming the firewall allows SSH connections).&lt;br /&gt;
&lt;br /&gt;
'''Setup the Secure Tunnel'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Putty-stunnel-rdp.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Connecting to the Remote SSH Server'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Putty-connect.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Launch an RDP session'''&amp;lt;br&amp;gt;&lt;br /&gt;
This may seem counter intuitive for an RDP connection, but the stunnel's local listening port is waiting for connections on 127.0.0.1 (aka localhost) at port 55555.&amp;lt;br&amp;gt;&lt;br /&gt;
All traffic (in this case RDP) sent to this port will be encrypted and passed through the tunnel and out the other side to &amp;lt;remote_pc.in&amp;gt;:3389 (where 3389 = default RDP port).&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Rdp-thru-stunnel.png]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;remote_pc.in&amp;gt; = The IP or Hostname of the PC you want to RDP into behind the firewall.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux / BSD command line equivalent is:&lt;br /&gt;
 ssh -f -N -L 55555:&amp;lt;remote_pc.in&amp;gt;:3389 &amp;lt;user@remote_host.out&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SSH Command Reference ==&lt;br /&gt;
 -f   Run in the background.&lt;br /&gt;
 -N   Do NOT execute a remote command.&lt;br /&gt;
 -L   Local binding address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SSH]]&lt;/div&gt;</summary>
		<author><name>Ledhed</name></author>	</entry>

	</feed>