<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: SSH and screen, better together</title>
	<atom:link href="http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/feed" rel="self" type="application/rss+xml" />
	<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together</link>
	<description>It's all spinning wheels and self-doubt until the first pot of coffee.</description>
	<lastBuildDate>Fri, 19 Mar 2010 00:06:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<item>
		<title>By: Nathan Nutter</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2091</link>
		<dc:creator>Nathan Nutter</dc:creator>
		<pubDate>Thu, 29 Sep 2005 03:27:56 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2091</guid>
		<description>&lt;p&gt;OK, Thank you. So it just saves you the hassle of having to reconnect to your remote session manually.&lt;/p&gt;

&lt;p&gt;You might look at this program &lt;a href=&quot;http://www.leapingbytes.com/almostvpn&quot; rel=&quot;nofollow&quot;&gt;AlmostVPN&lt;/a&gt;. I have been trying to figure out how to use it because my school has a server that us students are allowed to use to compile things and what not. But it also stores all our files on it so I have been trying to setup [AlmostVPN][2] to forward the Apple File Share that has our home directories on it. Unfortunately, I have not gotten it to work yet, but that is mostly because I have very limited knowledge of SSH. I use it in place of telnet but that is all I know how to do right now.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>OK, Thank you. So it just saves you the hassle of having to reconnect to your remote session manually.</p>
<p>You might look at this program <a href="http://www.leapingbytes.com/almostvpn" rel="nofollow">AlmostVPN</a>. I have been trying to figure out how to use it because my school has a server that us students are allowed to use to compile things and what not. But it also stores all our files on it so I have been trying to setup [AlmostVPN][2] to forward the Apple File Share that has our home directories on it. Unfortunately, I have not gotten it to work yet, but that is mostly because I have very limited knowledge of SSH. I use it in place of telnet but that is all I know how to do right now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l.m.orchard</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2088</link>
		<dc:creator>l.m.orchard</dc:creator>
		<pubDate>Thu, 29 Sep 2005 02:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2088</guid>
		<description>&lt;p&gt;Nathan: Well, the thing is that I&#039;m doing all of this on a PowerBook which travels with me between home / work / coffee shop.  I close it up, leave home, open it up on a new network.  Repeat at least twice a day.&lt;/p&gt;

&lt;p&gt;What autossh does is start an SSH connection and monitor it continuously to be sure it&#039;s up.  If the connection ever goes down, autossh starts it up again.&lt;/p&gt;

&lt;p&gt;So, instead of the usually SSH command to connect to a server at home, I use autossh.  When I open my PowerBook in a new location, autossh sees that it&#039;s lost the connection to home and automatically reconnects.  This way, I always have a terminal window to home—along with a handful of forwarded ports—even after travelling between networks.  And, since I&#039;m running &lt;code&gt;screen&lt;/code&gt; at home, everything I was doing before travelling is all in the same state I left it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nathan: Well, the thing is that I&#8217;m doing all of this on a PowerBook which travels with me between home / work / coffee shop.  I close it up, leave home, open it up on a new network.  Repeat at least twice a day.</p>
<p>What autossh does is start an SSH connection and monitor it continuously to be sure it&#8217;s up.  If the connection ever goes down, autossh starts it up again.</p>
<p>So, instead of the usually SSH command to connect to a server at home, I use autossh.  When I open my PowerBook in a new location, autossh sees that it&#8217;s lost the connection to home and automatically reconnects.  This way, I always have a terminal window to home—along with a handful of forwarded ports—even after travelling between networks.  And, since I&#8217;m running <code>screen</code> at home, everything I was doing before travelling is all in the same state I left it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan Nutter</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2087</link>
		<dc:creator>Nathan Nutter</dc:creator>
		<pubDate>Thu, 29 Sep 2005 02:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2087</guid>
		<description>&lt;p&gt;I don&#039;t understand what you use this or autossh for could you please explain how it works?&lt;/p&gt;

&lt;p&gt;Do you run it on the computer you want to connect to or on the computer you are connecting from? I understand the screen part, that just allows your terminal session to keep running when the terminal is disconnected. Why do you need to force on this persistent connection?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand what you use this or autossh for could you please explain how it works?</p>
<p>Do you run it on the computer you want to connect to or on the computer you are connecting from? I understand the screen part, that just allows your terminal session to keep running when the terminal is disconnected. Why do you need to force on this persistent connection?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l.m.orchard</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2054</link>
		<dc:creator>l.m.orchard</dc:creator>
		<pubDate>Tue, 27 Sep 2005 22:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2054</guid>
		<description>&lt;p&gt;Leland: Well, hey, whadda ya know?  I&#039;d never seen &lt;code&gt;autossh&lt;/code&gt; before—it looks like exactly what I need.  And it compiled on my PowerBook.  Thanks for the pointer!&lt;/p&gt;

&lt;p&gt;I think I like this blogging thing.  :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Leland: Well, hey, whadda ya know?  I&#8217;d never seen <code>autossh</code> before—it looks like exactly what I need.  And it compiled on my PowerBook.  Thanks for the pointer!</p>
<p>I think I like this blogging thing.  :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leland Johnson</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2052</link>
		<dc:creator>Leland Johnson</dc:creator>
		<pubDate>Tue, 27 Sep 2005 21:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2052</guid>
		<description>&lt;p&gt;Why not use &lt;a href=&quot;http://www.harding.motd.ca/autossh/&quot; rel=&quot;nofollow&quot;&gt;autossh&lt;/a&gt;? Instead of waiting for the connection to time out, it will know almost immediately. It also includes a script for doing exactly the same thing you do here (except with autossh of course).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Why not use <a href="http://www.harding.motd.ca/autossh/" rel="nofollow">autossh</a>? Instead of waiting for the connection to time out, it will know almost immediately. It also includes a script for doing exactly the same thing you do here (except with autossh of course).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle Pagaltzis</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2040</link>
		<dc:creator>Aristotle Pagaltzis</dc:creator>
		<pubDate>Tue, 27 Sep 2005 16:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2040</guid>
		<description>&lt;p&gt;Ryan: try &lt;a href=&quot;http://vtun.sourceforge.net/faq.html#1.23&quot; rel=&quot;nofollow&quot;&gt;vtun over SSH&lt;/a&gt;. It&#039;s a dead simple VPN system. There&#039;s a page on &lt;a href=&quot;http://www.shiftmanager.net/~kurt/VTUN_ON_OSX/VTUNonOSX.html&quot; rel=&quot;nofollow&quot;&gt;running vtun on OS X&lt;/a&gt;, though I don&#039;t know if it&#039;s up to date.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ryan: try <a href="http://vtun.sourceforge.net/faq.html#1.23" rel="nofollow">vtun over SSH</a>. It&#8217;s a dead simple VPN system. There&#8217;s a page on <a href="http://www.shiftmanager.net/~kurt/VTUN_ON_OSX/VTUNonOSX.html" rel="nofollow">running vtun on OS X</a>, though I don&#8217;t know if it&#8217;s up to date.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l.m.orchard</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2039</link>
		<dc:creator>l.m.orchard</dc:creator>
		<pubDate>Tue, 27 Sep 2005 15:51:50 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2039</guid>
		<description>&lt;p&gt;Ryan: Swank--I&#039;ll have to tinker around with this bit of scripting to see how I can improve my masochistic semi-VPN :)&lt;/p&gt;

&lt;p&gt;Aristotle:  Thanks for the pointer.  I think &lt;code&gt;while [ 1 ]&lt;/code&gt; is just one of those things I came to by trial-and-error.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ryan: Swank&#8211;I&#8217;ll have to tinker around with this bit of scripting to see how I can improve my masochistic semi-VPN :)</p>
<p>Aristotle:  Thanks for the pointer.  I think <code>while [ 1 ]</code> is just one of those things I came to by trial-and-error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle Pagaltzis</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2038</link>
		<dc:creator>Aristotle Pagaltzis</dc:creator>
		<pubDate>Tue, 27 Sep 2005 15:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2038</guid>
		<description>&lt;p&gt;Just &lt;abbr title=&quot;for what it&#039;s worth&quot;&gt;FWIW&lt;/abbr&gt;, the idiomatic way to express an infinite loop in &lt;i&gt;sh&lt;/i&gt; is&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;while : ; do foo ; done
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;According to &lt;code&gt;bash(1)&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;&lt;code&gt;: [arguments]
&lt;/code&gt;&lt;/pre&gt;

  &lt;p&gt;No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
		<content:encoded><![CDATA[<p>Just <abbr title="for what it's worth">FWIW</abbr>, the idiomatic way to express an infinite loop in <i>sh</i> is</p>
<pre><code>while : ; do foo ; done
</code></pre>
<p>According to <code>bash(1)</code>:</p>
<blockquote>
<pre><code>: [arguments]
</code></pre>
<p>No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned.</p>
</blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Tomayko</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2036</link>
		<dc:creator>Ryan Tomayko</dc:creator>
		<pubDate>Tue, 27 Sep 2005 15:33:43 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2036</guid>
		<description>&lt;p&gt;Right, right. Basically I can make it look like a small subset of the work LAN with just VIPs, hosts file modification, and ssh tunnels.&lt;/p&gt;

&lt;p&gt;So say I have two boxes at work - &lt;code&gt;work-box-1&lt;/code&gt; and &lt;code&gt;work-box-2&lt;/code&gt;, running SMB and a web server, respectively. I create a host file that points the host names to IPs on my home lan: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;/etc/hosts.ssh-vip-vpn&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; 192.168.1.130  work-box-1
 192.168.1.131  work-box-2
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, I have a little script that ups the VIPs using ifconfig, symlinks the hosts file, and opens the tunnels:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/bin/open-vpn&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/bash
ifconfig en1 inet 192.168.1.130 netmask 255.255.255.255 alias
ifconfig en1 inet 192.168.1.131 netmask 255.255.255.255 alias
ln -s /etc/hosts /etc/hosts.ssh-vip-vpn
ssh -L192.168.1.130:445:real-work-ip1:445 \
      -L192.168.1.130:137:real-work-ip1:137 \
      -L192.168.1.131:80:real-work-ip2:80 external-work-hostname
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The cool thing is that everything pretty much looks exactly as it does at work. It&#039;s quite a lot to maintain and a real VPN would be a ton easier but what fun is that?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Right, right. Basically I can make it look like a small subset of the work LAN with just VIPs, hosts file modification, and ssh tunnels.</p>
<p>So say I have two boxes at work &#8211; <code>work-box-1</code> and <code>work-box-2</code>, running SMB and a web server, respectively. I create a host file that points the host names to IPs on my home lan: </p>
<p><code>/etc/hosts.ssh-vip-vpn</code>:</p>
<pre><code> 192.168.1.130  work-box-1
 192.168.1.131  work-box-2
</code></pre>
<p>Next, I have a little script that ups the VIPs using ifconfig, symlinks the hosts file, and opens the tunnels:</p>
<p><code>~/bin/open-vpn</code>:</p>
<pre><code>#!/bin/bash
ifconfig en1 inet 192.168.1.130 netmask 255.255.255.255 alias
ifconfig en1 inet 192.168.1.131 netmask 255.255.255.255 alias
ln -s /etc/hosts /etc/hosts.ssh-vip-vpn
ssh -L192.168.1.130:445:real-work-ip1:445 \
      -L192.168.1.130:137:real-work-ip1:137 \
      -L192.168.1.131:80:real-work-ip2:80 external-work-hostname
</code></pre>
<p>The cool thing is that everything pretty much looks exactly as it does at work. It&#8217;s quite a lot to maintain and a real VPN would be a ton easier but what fun is that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l.m.orchard</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2031</link>
		<dc:creator>l.m.orchard</dc:creator>
		<pubDate>Tue, 27 Sep 2005 14:40:46 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2031</guid>
		<description>&lt;p&gt;Oh, duh, that&#039;s exactly what your links says:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Now you have another IP that you can bring stuff up on that won&#039;t collide with other stuff running on the same port.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
		<content:encoded><![CDATA[<p>Oh, duh, that&#8217;s exactly what your links says:</p>
<blockquote>
<p>Now you have another IP that you can bring stuff up on that won&#8217;t collide with other stuff running on the same port.</p>
</blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: l.m.orchard</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2030</link>
		<dc:creator>l.m.orchard</dc:creator>
		<pubDate>Tue, 27 Sep 2005 14:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2030</guid>
		<description>&lt;p&gt;Hmm...  I see how to create a VIP, but what do you do with it once you have it—with respect to SSH tunnels, that is?  Could you stick an SMB tunnel there on port 139, say, and keep it separate from port 139 on localhost?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hmm&#8230;  I see how to create a VIP, but what do you do with it once you have it—with respect to SSH tunnels, that is?  Could you stick an SMB tunnel there on port 139, say, and keep it separate from port 139 on localhost?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Tomayko</title>
		<link>http://decafbad.com/blog/2005/09/27/ssh-and-screen-better-together/comment-page-1#comment-2029</link>
		<dc:creator>Ryan Tomayko</dc:creator>
		<pubDate>Tue, 27 Sep 2005 14:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://decafbad.com/blog/?p=698#comment-2029</guid>
		<description>&lt;p&gt;A great tip.&lt;/p&gt;

&lt;p&gt;Speaking of this, I was messing around the other day and found that it&#039;s really easy to create VIPs in OS X. Combine your above example with &lt;a href=&quot;http://www.bigbold.com/snippets/posts/show/763&quot; rel=&quot;nofollow&quot;&gt;these directions for creating VIPs&lt;/a&gt; and you can set up a pretty functional VPN. I create VIPs for the hosts that are most interesting at work and have a custom hosts file map the work hostnames to the local IPs. Then when I open the tunnel with ssh I bind to the VIP IPs. It takes a little while to set everything up but the result is very nice. &lt;/p&gt;

&lt;p&gt;I&#039;m in the process of building up a simple config file syntax for specifying which hosts/ports should be tunneled and a little script that does all the dirty work of creating the VIPs and opening the ssh connection.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>A great tip.</p>
<p>Speaking of this, I was messing around the other day and found that it&#8217;s really easy to create VIPs in OS X. Combine your above example with <a href="http://www.bigbold.com/snippets/posts/show/763" rel="nofollow">these directions for creating VIPs</a> and you can set up a pretty functional VPN. I create VIPs for the hosts that are most interesting at work and have a custom hosts file map the work hostnames to the local IPs. Then when I open the tunnel with ssh I bind to the VIP IPs. It takes a little while to set everything up but the result is very nice. </p>
<p>I&#8217;m in the process of building up a simple config file syntax for specifying which hosts/ports should be tunneled and a little script that does all the dirty work of creating the VIPs and opening the ssh connection.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
