<?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>guylichtman.com &#187; php</title>
	<atom:link href="http://guylichtman.com/wordpress/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://guylichtman.com/wordpress</link>
	<description>What's on my mind?</description>
	<lastBuildDate>Sat, 12 Dec 2009 22:39:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Virtual Shell</title>
		<link>http://guylichtman.com/wordpress/2008/05/26/php-virtual-shell/</link>
		<comments>http://guylichtman.com/wordpress/2008/05/26/php-virtual-shell/#comments</comments>
		<pubDate>Mon, 26 May 2008 19:07:23 +0000</pubDate>
		<dc:creator>Guy Lichtman</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://guylichtman.com/wordpress/?p=17</guid>
		<description><![CDATA[Well its been a while since I&#8217;ve posted something with a technical nature. So, I decided to write about this small php script I&#8217;ve been using to get around hosting limitation regarding ssh access. As I&#8217;ve encountered some popular shared hosting providers (such as godaddy) do not provide ssh access. I am not sure why [...]]]></description>
			<content:encoded><![CDATA[<p>Well its been a while since I&#8217;ve posted something with a technical nature. So, I decided to write about this small php script I&#8217;ve been using to get around hosting limitation regarding ssh access. As I&#8217;ve encountered some popular shared hosting providers (such as godaddy) do not provide ssh access. I am not sure why this practice is so common. I am assuming it is more of a support issue than security, as it is possible to execute system commands via php.</p>
<p>This leads me to introduce my php virtual shell. It is basically a simple php script which receives input from the user and executes the command and displays the result. The added bonus is that this script also keeps a history of the commands and supports <strong>automatic history completion</strong>. I love the history and simple command search of modern shells, so I decided to add this to my virtual shell. </p>
<p>I used a javascript auto complete control which I found <a href="http://www.codeproject.com/KB/scripting/jsactb.aspx" target="_blank">here</a> . The script basically stores a history of the  commands in a file: .vshellhist, and every time the script is executed this file is used to build a javascript array containing all previous commands. From there on, the auto complete control goes into affect. For more details simply look at the code. It is pretty straight forward.  </p>
<p>The php code and relevant javascript files can be dowloaded here:  <a href='http://guylichtman.com/wordpress/wp-content/uploads/2008/05/php-vshell.zip'>php-vshell.zip</a>. To use this script first change the password in the script file. I put the password just for general protection against misuse. I recommend to also change the script file name. Note that the password is kept on file in the clear. For better protection, I would use a form of password authentication which at least keeps the password encrypted on disk. Probably easiest is to use Apache&#8217;s authentication mechanism through the use of a .htaccess file. Once the password is set simply upload the php and javascript files (all to the same directory) and start testing out your new shell.    </p>
]]></content:encoded>
			<wfw:commentRss>http://guylichtman.com/wordpress/2008/05/26/php-virtual-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
