You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.0 KiB

<h1>Using an SSH agent to avoid typing your password</h1>
<!-- Somebody better at it should put a nice introductory paragraph here -->
<h3>Do not use this tutorial until you <a href="http://sdf.org/?tutorials/SSH-SDF#public_key">make a unix account accessible via public key authentication following this tutorial</a>.</h3>
<p>Not only is typing your passphrase once convenient, you can <a href="http://xkcd.com/936/">make your password very complicated and only ever type an easy to remember passphrase to access all your accounts</a>.</p>
<ul>
<li>Unix<ul>
<li><a href="#shell">At the shell</a></li>
<li><a href="#anywm">Any Window Manager</a></li>
<li><a href="#gnome">Gnome</a></li>
<li><a href="#kde">KDE</a></li>
</ul>
<li><a href="#macos">MacOS X</a></li>
<li><a href="#windows">Windows</a></li>
</ul>
<h2 id="shell">At the shell</h2>
At any time, you can type<br/><br/>
<code>
ssh-agent /bin/ksh<br/>
ssh-add $HOME/private_key.rsa<br/>
</code>
<br/>
(you can replace <code>/bin/ksh</code> by your favorite shell). Any command issued from then on that uses <code>ssh</code> to interact with a server that hosts your public key (e.g. <code>ssh, sshfs, rsync</code>) will not require a password e.g.
<br/><br/>
<code>
home_pc$ ssh-agent /bin/ksh<br/>
home_pc$ ssh-add $HOME/public_key.rsa<br/>
Enter passphrase for /home/user/public_key.rsa:<br/>
Identity added: /home/user/public_key.rsa (/home/user/public_key.rsa)<br/>
home_pc$ ssh miku.freeshell.org<br/>
miku$
</code>
<br/><br/>
<h2 id="anywm">Any Window Manager</h2>
Arrange to have<br/><br/>
<code>
ssh-add $HOME/private_key.rsa
</code>
<br/><br/>
run at login (e.g. via $HOME/.xinitrc or as a "Startup Application in Gnome/KDE"). You should get a popup asking for your passphrase.
<h2 id="gnome">Gnome</h2>
<h2 id="KDE">KDE</h2>
<h2 id="macos">Mac OS X</h2>
<h2 id="windows">Windows</h2>
You may have to change your openssh formatted private key to PuTTY's .ppk format via <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTYgen</a>.
<br/><br/>
$Id: agent.html,v 1.3 2011/09/11 13:31:10 jbaber Exp $