<?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>ClearChain &#187; keys</title>
	<atom:link href="http://www.clearchain.com/blog/tags/keys/feed" rel="self" type="application/rss+xml" />
	<link>http://www.clearchain.com/blog</link>
	<description>-= Daily Happenings =-</description>
	<lastBuildDate>Sun, 25 Jul 2010 15:47:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>OPIE &#8211; One Time Keys</title>
		<link>http://www.clearchain.com/blog/posts/opie-one-time-keys</link>
		<comments>http://www.clearchain.com/blog/posts/opie-one-time-keys#comments</comments>
		<pubDate>Sat, 08 Nov 2008 01:44:50 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[keys]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=88</guid>
		<description><![CDATA[Using External SSH access with normal password authentication is dangerous. It is susceptible to the following problems: People can use weak passwords which are easy to hack A remote machine may have a key logger on it Someone may be performing a man-in-the-middle type attack Hence if you wish to access a shell account or [...]]]></description>
			<content:encoded><![CDATA[<p>Using External SSH access with normal password authentication is dangerous. It is susceptible to the following problems:</p>
<ul>
<li> People can use weak passwords which are easy to hack</li>
<li> A remote machine may have a key logger on it</li>
<li> Someone may be performing a man-in-the-middle type attack</li>
</ul>
<p>Hence if you wish to access a shell account or scp files remotely you should consider using either public/private keys setup or to setup <em>One Time Keys</em>.</p>
<h2><span class="mw-headline">Setting Up One Time Keys </span></h2>
<p><a name="Log_in_to_the_box_.28AS_SECURELY_AS_POSSIBLE.29"></a></p>
<h3><span class="mw-headline">Log in to the box (AS SECURELY AS POSSIBLE) </span></h3>
<p>Logging in securely is important as you&#8217;ll be asked for a pass phrase. If this is compromised you&#8217;re in trouble.</p>
<p><a name="Enable_OTP"></a></p>
<h3><span class="mw-headline"> Enable OTP </span></h3>
<p>Run:</p>
<pre> opiepasswd -c</pre>
<p>This will enable one time keys, asking you for the pass phrase as a seed for the cipher.</p>
<p>Once run one time keys are enabled.</p>
<p>The output of the command (something like):</p>
<pre> ID closebs OTP key is 499 wc8001
 THY HOOK TRY FREY DED DEDE</pre>
<p>tells you a lot.</p>
<ul>
<li> The <em>499</em> is the number of the current One Time Password.</li>
<li> The <em>wc80001</em> is a key to go with your pass phrase if you want to generate the 499 login password.</li>
<li> The <em>THY HOOK&#8230;</em> is the password for key 499</li>
</ul>
<p><a name="Finding_out_the_next_N_passwords"></a></p>
<h3><span class="mw-headline">Finding out the next N passwords </span></h3>
<p>To discover the next N One Time Passwords for printing use:</p>
<pre> opiekey -n NUM SEQ KEY</pre>
<p>where:</p>
<ul>
<li> NUM is the amount of passwords to generate</li>
<li> SEQ is the sequence number of the password to start with</li>
<li> KEY is the key given for the cipher</li>
</ul>
<p>Ie:</p>
<pre> opiekey -n 10 499 wc80001</pre>
<p>This will display 10 keys, starting with key 499 and using the key wc80001. This can be useful as you can then print out the keys, and put them in your wallet/purse. <em>WHAT</em> I hear you say?</p>
<p>The reality is most passwords are broken by remote hackers. Whilst printing a list of one time passwords may seem insecure, the likely hood of someone going through your purse/wallet to find the printed out keys is very low. If you are concerned about it, simple put a simple transposition in each key that only you will know about.</p>
<p><a name="Disabling_OTP_access"></a></p>
<h3><span class="mw-headline">Disabling OTP access </span></h3>
<p>Help my keys have been compromised!</p>
<p>Get someone to run:</p>
<pre> opiepasswd -d</pre>
<p>in your account.</p>
<p><a name="Changing_your_OTP_Pass_Phrase"></a></p>
<h3><span class="mw-headline">Changing your OTP Pass Phrase </span></h3>
<p>Simply run:</p>
<pre> opiepasswd</pre>
<p>This will ask you for the next OTP in order to allow you to change your key (incase your remote) Once changed all your all your existing keys will now become invalid.</p>
<p><a name="Using_One_Time_Passwords"></a></p>
<h2><span class="mw-headline"> Using One Time Passwords </span></h2>
<p>Any time you try to ssh to the WCL, you will be presented with:</p>
<pre> otp-md5 497 psfasdf ext
 Password:</pre>
<p>This indicates you are required to provide password <em>497</em>. The seed is given so you can generate the required password using it and your pass phrase if required.</p>
<p>Depending on the server setup, you can also enter your regular password at this point.</p>
<p>There is no way of telling if the server will accept your regular password or not unless you know it&#8217;s configuration.</p>
<p><a name="Your_Away.2C_don.27t_have_any_passwords_or_pub.2Fprivate_keys_but_have_access_to_a_secure_machine"></a></p>
<h3><span class="mw-headline">Your Away, don&#8217;t have any passwords or pub/private keys but have access to a secure machine </span></h3>
<p>As long as you can guarentee the machine you are on is secure, then chances are you can generate yourself the next password in the sequence in order to be able to access the remote box.</p>
<p>On the box your on run:</p>
<pre>   opiekey  SEQUENCENUM SEED</pre>
<p>You can get SEQUENCENUM &amp; SEED just by sshing to the box and not logging in. You&#8217;ll need your pass phrase though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/opie-one-time-keys/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up SSH Public/Private Keys</title>
		<link>http://www.clearchain.com/blog/posts/setting-up-ssh-publicprivate-keys</link>
		<comments>http://www.clearchain.com/blog/posts/setting-up-ssh-publicprivate-keys#comments</comments>
		<pubDate>Fri, 07 Nov 2008 04:19:51 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[dsa]]></category>
		<category><![CDATA[keys]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[rsa]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=66</guid>
		<description><![CDATA[Using SSH for Automatic Key authentication SSH provides an encrypted tunnel for use with interactive and non interactive terminal sessions. It provides authentication via a number of methods including password, public/private key pairs and challenge keys. SSH also provides authentication forwarding between machines. This feature allows a user to be able to log on to [...]]]></description>
			<content:encoded><![CDATA[<h6><span class="mw-headline">Using SSH for Automatic Key authentication</span></h6>
<p>SSH provides an encrypted tunnel for use with interactive and non interactive terminal sessions. It provides authentication via a number of methods including password, public/private key pairs and challenge keys.</p>
<p>SSH also provides authentication forwarding between machines. This feature allows a user to be able to log on to a machine without the need of typing a password. This is an extreemly strong feature as it means you can provide access to an account or even to execute a command without the need to provide someone with a password.</p>
<p><span id="more-66"></span></p>
<p>In order to setup public/private key authentication forwarding both the client and the server must have knowledge of the relevant keys. You must also consider the version of SSH software that the server/client is running as different versions use different files. Generating SSH Keys</p>
<p>The first step is to generate an SSH private/public key pair. For this I assume you are using some version of OpenSSH. There is currently three types of ssh key pairs that can be generated. They are rsa1, rsa and dsa. Of these dsa is the most secure and is the one used by ssh2. To generate the key perform the following:</p>
<pre>  ssh-keygen -t rsa1
  ssh-keygen -t rsa
  ssh-keygen -t dsa</pre>
<p>The public/private keys will be installed in the following places</p>
<table border="2" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<td>SSH Version</td>
<td>Key Type</td>
<td>OpenSSH</td>
<td>SSH 2(Commercial)</td>
</tr>
<tr>
<td>old ssh1</td>
<td>rsa1</td>
<td>~/.ssh/identity &amp; ~/.ssh/identity.pub</td>
<td>Not Generatable</td>
</tr>
<tr>
<td>ssh1</td>
<td>rsa2</td>
<td>~/.ssh/id_rsa &amp; ~/.ssh/id_rsa.pub</td>
<td>~/.ssh2/id_rsa_[keywidth]_a &amp; /.ssh2/id_rsa_[keywidth]_a.pub</td>
</tr>
<tr>
<td>ssh2</td>
<td>dsa</td>
<td>~/.ssh/id_dsa &amp; ~/.ssh/id_dsa.pub</td>
<td>~/.ssh2/id_dsa_[keywidth]_a &amp;/.ssh2/id_dsa_[keywidth]_a.pub</td>
</tr>
</tbody>
</table>
<p><a name="Automated_Authentication"></a></p>
<h5><span class="mw-headline">Automated Authentication</span></h5>
<p>With the keys generated it is now possible to setup automatic key authentication. This means when you log in to a machine you don&#8217;t need to enter your password. The authentication happens by the server encrypting some data with your public key then challenging the client to decript it. For this to happen, the client must have the private key matching the public key.</p>
<p>The procedure to set this up varies up which server you attempting to access. The procedure is basically as follows:</p>
<pre>  scp [publickey] user@host:~
  ssh user@host
  cat [publickey] &gt;&gt; [filename]</pre>
<p>The above is the basic procedure. However the publickey and filename vary depending on the server/client you are using. A valid example for OpenSSH using dsa keys is:</p>
<p> </p>
<pre>  scp ~/.ssh/id_dsa.pub user@host:~
  ssh user@host
  cat id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys2</pre>
<p>The table below shows which file to copy where:</p>
<table border="2" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<td>Local OpenSSH Key</td>
<td>OpenSSH (Remote Machine)</td>
<td>SSH2(Commercial) (Remote Machine)</td>
</tr>
<tr>
<td>identity.pub</td>
<td>Unknown At present</td>
<td>Unknown at present</td>
</tr>
<tr>
<td>id_rsa.pub</td>
<td>~/.ssh/authorized_keys</td>
<td><span class="reference"><sup>1</sup></span> ~/.ssh2/id_rsa_SECSH.pub &amp; &#8220;echo key id_rsa_SECSH.pub &gt;&gt; authorization&#8221;</td>
</tr>
<tr>
<td>id_dsa.pub</td>
<td>~/.ssh/authorized_keys2</td>
<td><span class="reference"><sup>1</sup></span> ~/.ssh2/id_dsa_SECSH.pub &amp; &#8220;echo key id_dsa_SECSH.pub &gt;&gt; authorization&#8221;</td>
</tr>
</tbody>
</table>
<p><cite id="fn_1">Note 1: </cite>In order to generate an SECSH compliant key the following OpenSSH Command can be used:</p>
<pre>  ssh-keygen -e -f [KEY].pub &gt; [KEY]_SECSH.pub</pre>
<div><span><br />
</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/setting-up-ssh-publicprivate-keys/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
