<?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>handyfloss &#187; ssh</title>
	<atom:link href="http://handyfloss.net/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://handyfloss.net</link>
	<description>Because FLOSS is handy, isn&#039;t it?</description>
	<lastBuildDate>Mon, 21 May 2012 06:44:32 +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>Reverse SSH to twart over-zealous firewalls</title>
		<link>http://handyfloss.net/2010.01/reverse-ssh-to-twart-over-zealous-firewalls/</link>
		<comments>http://handyfloss.net/2010.01/reverse-ssh-to-twart-over-zealous-firewalls/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 13:18:54 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=951</guid>
		<description><![CDATA[I guess it is not very uncommon, since it has happened twice to me, in two sites I have worked. &#8220;Over-cautious&#8221; sysadmins decide that the University, Institute, Corporation, or whatever, would be safer if connections to the LAN from outside of it were banned, including the port 22. In an effort to avoid making security [...]]]></description>
			<content:encoded><![CDATA[<p>I guess it is not very uncommon, since it has happened twice to me, in two sites I have worked. &#8220;Over-cautious&#8221; sysadmins decide that the University, Institute, Corporation, or whatever, would be safer if connections to the <a href="http://en.wikipedia.org/wiki/LAN">LAN</a> from outside of it were banned, including the <a href="http://en.wikipedia.org/wiki/Secure Shell">port 22</a>. In an effort to avoid making security trample service (how considerate!) the usual solution to allow remote conection is to use <a href="http://en.wikipedia.org/wiki/VPN">VPN</a>.</p>
<p>While VPN might have some advantages over SSH, I prefer the latter by far, and don&#8217;t think a proper SSH setup has any lack of security, specially comparing to poorly implemented VPNs. For example, I would never trust something as vital as VPN software to a private company, yet most popular VPNs are proprietary (at least the University of the Basque Country uses the Cisco VPN). It is at least paradoxical that a free and open SSH implementation as e.g. <a href="http://en.wikipedia.org/wiki/OpenSSH">OpenSSH</a>, tested in such a throughout way, and for so long, is dumped, and a black-box solution developed by a profit-driven organization is used instead.</p>
<p>But I digress. I am not interesting in justifying why I want SSH. What I want to show here is a trick I learned reading <a href="http://www.tuxradar.com/content/command-line-tricks-smart-geeks">tuxradar.com</a>. Esentially, allows one to connect (with SSH) from machine A to machine B, even if machine B has all ports closed (so SSH-ing using another port would be useless either).</p>
<p>The idea (see below) is to connect from machine B to A, which is allowed (and is also the exact reverse of what we actually want to do), in a way that opens a canal for a &#8220;reverse&#8221; connection from A to B:</p>
<div class="codeblock">
<i>(In machine_B)</i><br />
% ssh -R 1234:localhost:22 username_in_A@machine_A
</div>
<p>Then we will be able to use port 1234 (or whatever port we specify in the <tt>ssh -R</tt> command above) in machine A to connect to machine B, as long as the original <tt>ssh -R</tt> holds:</p>
<div class="codeblock">
<i>(In machine_A)</i><br />
% ssh username_in_B@localhost -p 1234
</div>
<p>The picture shows it better:</p>
<div align="center">
<img src="http://isilanes.org/pub/blog/pics/ssh-R.png">
</div>
<p>SSHing from A to B (dashed red arrow) is disallowed, but the reverse (in black) is not. The <tt>ssh -R</tt> command line (see code above), opens up the link between ports 22 and 1234 (two-headed black arrow), so that a <tt>ssh -p</tt> to port 1234 in machine A will redirect us to machine B. If we are asked for a password (at the <tt>ssh -p</tt> stage), they are requesting the one for <b>machine B</b>, since we are being redirected to machine B.</p>
<p>Please, recall that the above recipe is no less secure than a regular SSH from A to B (if it were allowed), since anyone SSHing to port 1234 in machine A will be automatically redirected to machine B, but undergoing the same security checks as usual (password, public/private key&#8230;). Note also that I am talking about what is possible, not necessarily desirable or comfortable. It&#8217;s just another tool if you want to use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.01/reverse-ssh-to-twart-over-zealous-firewalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

