<?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>CodeBlog.ch &#187; Linux</title>
	<atom:link href="http://www.codeblog.ch/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codeblog.ch</link>
	<description>Coding and more - Concrete5, Flex, JavaScript</description>
	<lastBuildDate>Fri, 18 Jun 2010 08:05:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux Shell in a Browser</title>
		<link>http://www.codeblog.ch/2010/02/linux-shell-in-a-browser/</link>
		<comments>http://www.codeblog.ch/2010/02/linux-shell-in-a-browser/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 12:37:43 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=440</guid>
		<description><![CDATA[If you&#8217;re a *unix admin you probably like SSH a lot. Even if you have to work on a Windows computer you can simply download a small tool like Putty and you&#8217;re ready to work on your server. However, there are situations where not even Putty works &#8211; if you&#8217;re behind a firewall that filters [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a *unix admin you probably like SSH a lot. Even if you have to work on a Windows computer you can simply download a small tool like <a href="http://putty.very.rulez.org/download.html">Putty</a> and you&#8217;re ready to work on your server. However, there are situations where not even Putty works &#8211; if you&#8217;re behind a firewall that filters the outgoing traffic as well. It usually makes sense to block outgoing SSH traffic in a big company because you could easily create an encrypted tunnel to move secret data to any server you want.</p>
<p>But there&#8217;s another way to access your server using SSH like tools without having to worry about encrypted tunnels or any other threats SSH could cause. It&#8217;s called <a href="http://code.google.com/p/shellinabox/">shellinabox</a> and can be found on Google Code.</p>
<p>If you&#8217;re working with debian like I do, you can even download a prebuilt deb file.<br />
<code lang="bash">wget http://shellinabox.googlecode.com/files/shellinabox_2.10-1_i386.deb<br />
dpkg -i shellinabox_2.10-1_i386.deb</code></p>
<p>The installer creates an init script located in /etc/init.d/shellinabox. As soon as it has been started you can access your shell using any webbrowser using an address like this: https://localhost:4200. But the port 4200 is usually not accessible if you&#8217;re working behind a firewall that blocks SSH traffic. Let&#8217;s use apache to redirect traffic from HTTPS to 4200. We have to enable mod_proxy if it&#8217;s not already active:</p>
<p><code lang="bash">/etc/apache2/mods-enabled<br />
ln -s ../mods-available/proxy.conf<br />
ln -s ../mods-available/proxy.load<br />
ln -s ../mods-available/proxy_http.load</code></p>
<p>Edit the site file where you want to add your shell, I used /etc/apache2/sites-available/default-ssl and added these lines:<br />
<code lang="bash">&lt;Location /shell&gt;<br />
ProxyPass	http://localhost:4200/<br />
Order 	allow,deny<br />
Allow	from all<br />
&lt;/Location&gt;</code></p>
<p>Shellinabox uses https by default as well and is accessible by any ip address. We want to change that, let&#8217;s edit this file /etc/init.d/shellinabox and add SHELLINABOX_ARGS (the last line in the following box):<br />
<code># Set some default values<br />
SHELLINABOX_DATADIR="${SHELLINABOX_DATADIR:-/var/lib/shellinabox}"<br />
SHELLINABOX_PORT="${SHELLINABOX_PORT:-4200}"<br />
SHELLINABOX_USER="${SHELLINABOX_USER:-shellinabox}"<br />
SHELLINABOX_GROUP="${SHELLINABOX_GROUP:-shellinabox}"<br />
SHELLINABOX_ARGS="--localhost-only --disable-ssl"</code></p>
<p>If you now restart all the services &#8220;/etc/init.d/shellinabox restart&#8221; and /etc/init.d/apache2 restart&#8221;, you&#8217;re shell can be accessed by https://localhost/shell from anywhere you want!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2010/02/linux-shell-in-a-browser/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
