<?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>Conceptric &#187; ssh</title>
	<atom:link href="http://www.conceptric.co.uk/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://www.conceptric.co.uk</link>
	<description>Ideas and Applications</description>
	<lastBuildDate>Fri, 12 Aug 2011 13:00:25 +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>A remote future for my Mac mini</title>
		<link>http://www.conceptric.co.uk/a-remote-future-for-my-mac-mini.htm</link>
		<comments>http://www.conceptric.co.uk/a-remote-future-for-my-mac-mini.htm#comments</comments>
		<pubDate>Fri, 11 Apr 2008 16:18:01 +0000</pubDate>
		<dc:creator>James Whinfrey</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Mac User]]></category>
		<category><![CDATA[Personal Perspectives]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac mini]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[vine server]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://www.jameswhinfrey.co.uk/?p=46</guid>
		<description><![CDATA[I&#8217;ve come up with a brilliant idea to reuse my old Mac mini. I&#8217;m going to convert it into a server on my local network for development and hosting our personal web projects. OK&#8230; not very original, but the key point is that I want to be able to use the wireless networking, stick it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come up with a brilliant idea to reuse my old Mac mini. I&#8217;m going to convert it into a server on my local network for development and hosting our personal web projects.</p>

<p>OK&#8230; not very original, but the key point is that I want to be able to use the wireless networking, stick it anywhere, and not have to worry about peripherals. A very mobile server.</p>

<p>I already work with remote servers over public networks, and rarely use anything but the command line. For this project I wanted to be able to use the Mac desktop. This seemed the perfect excuse to play with <abbr title="Virtual Network Computing">VNC</abbr>. Additionally, I frequently use <abbr title="Secure SHell">SSH</abbr> and <abbr title="Public Key Infrastructure">PKI</abbr> for encryption and authentication respectively, but not VNC.</p>

<h3>The Plan.</h3>

<p>It seemed to me that there were several parts to the problem, with only one of which I&#8217;m familiar.</p>

<ol>
<li>Configure a VNC Client on the local machine.</li>
<li>Configure a VNC Server on the remote machine behind a firewall.</li>
<li>Enable SSH communication through the firewall.</li>
<li>Lock it all up using an SSH tunnel through the firewall so the Server and Client could talk.</li>
</ol>

<p>Now to work!</p>

<h3>The Client.</h3>

<p>I settled on <a href="http://sourceforge.net/projects/cotvnc/">Chicken of the VNC</a> (<abbr title="Chicken of the VNC">COTVNC</abbr>), a open source project providing a VNC Client for Mac OS-X. Great, that&#8217;s just what I want and it gets good reviews, but I guess most other clients out there would work too.</p>

<p>Once installed COTVNC takes almost no configuration, that all comes later in the SSH and Server.</p>

<div style="text-align:center;"><img src="http://www.jameswhinfrey.co.uk/wp-content/uploads/cotvnc-login.jpg" title="Connection with COTVNC" alt="Connection set-up dialogue for Chicken of the VNC" width="400" height="247" /></div>

<p>You might be able to see that I set up two connections; one for an unsecured connection, so that I could see if the security measures locked me out later; and this one for the secured connection, that&#8217;s why the host is the local machine.</p>

<h3>The Server.</h3>

<p>First I tried Apple Remote Desktop (<abbr title="Apple Remote Desktop">ARD</abbr>), but found it a little slow, but more importantly I couldn&#8217;t find a way to close the two ports in the firewall that the service automatically opened. While I&#8217;m diligently using SSH tunnelling to avoid compromising the security of my machine, these two ports are sitting there waiting for attack!</p>

<p>Time to try a different approach. I chose to disable the ARD service, closing the firewall again and installed a third party VNC server. The one I selected was <a href="http://www.redstonesoftware.com/products/vine_server">Vine Server from Redstone Software</a>. The reason? Nothing better that I&#8217;d read good things about it in blogs and on message boards, it&#8217;s available for Mac OS-X, and it&#8217;s free.</p>

<div style="text-align:center;"><img src="http://www.jameswhinfrey.co.uk/wp-content/uploads/vine-server-distro.jpg" title="Vine Server for Mac OS-X" alt="What is in the box for Vine Server on Mac OS-X" width="356" height="208" /></div>

<p>For Mac OS-X it downloads as a disk image containing the Server and a Viewer. I just wanted the Server as I&#8217;m using COTVNC, so a drag toward the Applications folder and a double click later I&#8217;m ready to configure things.</p>

<p>Vine server can be run in two different modes; as a System Server that starts automatically whenever the Mac starts up; or as a Desktop Server that can be run like any other application. Since I want to run my Mac mini as a remote headless &#8212; no keyboard, mouse or monitor &#8212; server, I only configured the System Server.</p>

<div style="text-align:center;"><img src="http://www.jameswhinfrey.co.uk/wp-content/uploads/system-server-settings.jpg" title="Vine System Server settings" alt="Settings dialogue for Vine System Server" width="456" height="435" /></div>

<p>Not especially difficult, but the eagle&#8210;eyed out there might have spotted that I didn&#8217;t enable the &#8220;Require Remote Login&#8221; option; in fact I did the first time and bang went any connection. I reasoned that I&#8217;m using SSH tunnelling, so the Server won&#8217;t realise that the connection <em>IS</em> via SSH and block it.</p>

<p>Set the System Server running, checking that it starts up again after a restart, and that&#8217;s the Server done.</p>

<h3>The Secure Protocol.</h3>

<p>Actually, this was pretty easy. Go to <em>System Preferences</em> > <em>Sharing</em> and enable the Remote Login service.</p>

<div style="text-align:center;"><img src="http://www.jameswhinfrey.co.uk/wp-content/uploads/sharing-settings.jpg" title="Sharing settings" alt="Settings to enable the Remote Login service on Mac OS-X" width="400" height="238" /></div>

<p>Make sure that the other services are disabled, unless you have a particular use for them; I&#8217;ll be enabling the Web Sharing service later. This should ensure that the firewall is closed on all ports except the one used for SSH &#8212; port 22.</p>

<h3>The Tunnel.</h3>

<p>The idea of the SSH tunnel was to forward any communications sent between port 5900 &#8212; the default VNC port &#8212; on the local machine and the remote machine, through an encrypted SSH connection.</p>

<p>Now there are lots of utilities to help you manage your SSH world, but I tend to use <a href="http://www.phil.uu.nl/~xges/ssh/">SSH-Agent</a> and the command line. I primarily use SSH-Agent to manage authentication, but it does have the ability to construct tunnels.</p>

<div style="text-align:center;"><img src="http://www.jameswhinfrey.co.uk/wp-content/uploads/ssh-agent-tunnel.jpg" title="SSH-Agent tunnel set-up" alt="Set-up dialogue for SSH tunnels in SSH-Agent" width="500" height="112" /></div>

<p>If you&#8217;ve got PKI set up, you won&#8217;t even need to enter any passwords in order to establish the connection.</p>

<h3>The Result.</h3>

<p>Once your tunnel is connected, you can start up COTVNC, or equivalent, and log&#8210;in!</p>

<div style="text-align:center;"><img src="http://www.jameswhinfrey.co.uk/wp-content/uploads/a-remote-mac1.jpg" title="A desktop over VNC" alt="An image of the desktop on the remote machine" width="400" height="257" /></div>

<p>Everything appears to work and I find Vine Server much more responsive than the Apple free offering.</p>

<p><em>By the way, I tried logging in with the unsecured connection and was kicked out.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.conceptric.co.uk/a-remote-future-for-my-mac-mini.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

