http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../shared/copy.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="generator" content=
  "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org" />
  <meta http-equiv="Content-Type" content=
  "text/html; charset=utf-8" />

  <title>SSH Without a Password</title>
  <link href="../shared/site.css" type="text/css" 
        rel="stylesheet" />
</head>

<body>
  <h2 class="c1">SSH Without a Password</h2>

  <p>The following steps can be used to ssh from one system to
  another without specifying a password.</p>
  
  <h3>Notes:</h3>

  <ul>
    <li>The system from which the ssh session is started via the
    ssh command is the <b><i>client</i></b>.</li>
    <li>The system that the ssh session connects to is the 
    <b><i>server</i></b>.</li>

    <li>These steps seem to work on systems running <a href=
    "http://www.openssh.org">OpenSSH</a>.</li>

    <li>The steps assume that a DSA key is being used. To use a RSA
    key substitute 'rsa' for 'dsa'.</li>

    <li>The steps assume that you are using a Bourne-like shell
    (sh, <a href="http://www.kornshell.com/">ksh</a> or <a href=
    "http://www.gnu.org/software/bash/bash.html">bash</a>)</li>

    <li>Some of this information came from:<br />
      <a href=      "http://www.der-keiler.de/Mailing-Lists/securityfocus/Secure_Shell/2002-12/0083.html">http://www.der-keiler.de/Mailing-Lists/securityfocus/Secure_Shell/2002-12/0083.html</a>
    </li>
  </ul>
  <h3>Steps:</h3>

  <ol>
    <li>
      <p>On the <b><i>client</i></b> run the following
      commands:</p>
      <pre>
$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''
</pre>This should result in two files, $HOME/.ssh/id_dsa (private
key) and $HOME/.ssh/id_dsa.pub (public key).
    </li>

    <li>
      <p>Copy $HOME/.ssh/id_dsa.pub to the
      <b><i>server</i></b>.</p>
    </li>

    <li>
      <p>On the <b><i>server</i></b> run the following
      commands:</p>
      <pre>
$ cat id_dsa.pub &gt;&gt; $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2
</pre>Depending on the version of OpenSSH the following commands
may also be required:
      <pre>
$ cat id_dsa.pub &gt;&gt; $HOME/.ssh/authorized_keys
$ chmod 0600 $HOME/.ssh/authorized_keys
</pre>An alternative is to create a link from authorized_keys2 to
authorized_keys:
      <pre>
$ cd $HOME/.ssh &amp;&amp; ln -s authorized_keys2 authorized_keys
</pre>
    </li>

    <li>
      <p>On the <b><i>client</i></b> test the results by ssh'ing to
      the <b><i>server</i></b>:</p>
      <pre>
$ ssh -i $HOME/.ssh/id_dsa <b><i>server</i></b>
</pre>
    </li>

    <li>
      <p>(Optional) Add the following $HOME/.ssh/config on the
      <b><i>client</i></b>:</p>
      <pre>
Host <b><i>server</i></b>
         IdentityFile ~/.ssh/id_dsa
</pre>This allows ssh access to the <b><i>server</i></b> without
having to specify the path to the id_dsa file as an argument to ssh
each time.
    </li>
  </ol>
  
  <h3>Helpful manpages:</h3>

  <ul>
    <li><a href=
    "http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html">
    ssh(1)</a></li>

    <li><a href=
    "http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html">
    ssh-keygen(1)</a></li>

    <li><a href=
    "http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html">
    ssh_config(5)</a></li>
  </ul>

    <hr />

  <div class="c3">

    <p>
    <span class="c2">
    Valid
    <a href="http://validator.w3.org/check/referer">XHTML</a> and 
    <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>

    &nbsp;//&nbsp;
    
    <!-- Creative Commons License -->
    Licensed under a 
    <a rel="license" href=
    "http://creativecommons.org/licenses/by/2.5/">Creative Commons 
    Attribution 2.5 License</a>
    <!-- /Creative Commons License -->

    </span>
    </p>

    <!--
    <rdf:RDF xmlns="http://web.resource.org/cc/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
        <Work rdf:about="">
            <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
            <license 
            rdf:resource="http://creativecommons.org/licenses/by/2.5/" />
        </Work>
        <License rdf:about="http://creativecommons.org/licenses/by/2.5/">
            <permits 
            rdf:resource="http://web.resource.org/cc/Reproduction" />
            <permits 
            rdf:resource="http://web.resource.org/cc/Distribution" />
            <requires 
            rdf:resource="http://web.resource.org/cc/Notice" />
            <requires 
            rdf:resource="http://web.resource.org/cc/Attribution" />
            <permits 
            rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
        </License>
    </rdf:RDF>
    -->

    <span class="c2">
    $Id: ssh_nopass.html 316 2006-08-06 05:21:59Z ranga $
    </span>
  </div>
</body>
</html>
