<?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>The Stata Things &#187; cp</title>
	<atom:link href="http://enoriver.net/index.php/tag/cp/feed/" rel="self" type="application/rss+xml" />
	<link>http://enoriver.net</link>
	<description>computing for fun and profit</description>
	<lastBuildDate>Tue, 31 Jan 2012 20:03:36 +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>OpenSSH, take two</title>
		<link>http://enoriver.net/index.php/2008/10/08/openssh-take-two/</link>
		<comments>http://enoriver.net/index.php/2008/10/08/openssh-take-two/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 22:08:17 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[cp]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[OpenSSH]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=203</guid>
		<description><![CDATA[Today I had to re-generate my key files for OpenSSH authentication. Between August and now I had forgotten how exactly that is done. So for next time this happens, here are detailed step-by-step instructions: 1) plug FAT32-formatted USB stick into PC-BSD laptop; it will be automatically mounted as /media/fattie 2) from terminal window, do this: [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to re-generate my key files for OpenSSH authentication. Between August and now I had forgotten how exactly that is done. So for next time this happens, here are detailed step-by-step instructions:</p>
<p>1) plug FAT32-formatted USB stick into PC-BSD laptop; it will be automatically mounted as /media/fattie</p>
<p>2) from terminal window, do this:</p>
<p><code>% ssh-keygen -t dsa</code></p>
<p>keep default names (id_dsa, id_dsa.pub) and path (/usr/home/myusername/.ssh).</p>
<p>3) copy id_dsa.pub to the USB stick:</p>
<p><code>% cp /usr/home/my_laptop_username/.ssh/id_dsa.pub /media/fattie</code></p>
<p>4) move this file to the server; will have to mount the USB stick like so:</p>
<p><code># mount_msdosfs /dev/da0s1 /mnt</code></p>
<p>5) overwrite this file onto the authorized_keys file:</p>
<p><code># mv /mnt/id_dsa.pub /usr/home/my_server_username/.ssh/authorized_keys</code></p>
<p>6) unmount USB stick and you're done:</p>
<p><code># umount /mnt</code></p>
<p>Now, to test the connection, get back to the laptop and connect from a terminal window:</p>
<p><code>% ssh my_server_username@myserver.homeip.net</code></p>
<p>And all is well. Now you need to set up the Windows XP laptop, both PuTTY (done it before) and Cygwin (that's a new one). Use same id_dsa private key for convenience, so while still on the PC-BSD laptop, plug the USB stick back in and copy the private key:</p>
<p><code>% cp /usr/home/my_laptop_username/.ssh/id_dsa /media/fattie<span style="font-family: 'Lucida Grande';"> </span></code></p>
<p>OK, on to the Windows laptop. Plug in the USB stick and do two things: first, use puttygen.exe to convert the id_dsa file into PuTTY's own .pkp format, so you can connect to the server with PuTTY. Second, save id_dsa as-is in the Cygwin .ssh folder (/home/my_Windows_username/.ssh) so you can connect from Cygwin as you would from the PC-BSD laptop, with the ssh command.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2008/10/08/openssh-take-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

