9.5.5 Setting up ssh-agent
It is safer to protect your SSH authentication key with a passphrase. If it
was not set, use ssh-keygen -p to set it.
Place your public key (e.g. ~/.ssh/id_rsa.pub
) into
~/.ssh/authorized_keys
on a remote host using a password-based
connection to the remote host as described in
Connecting
with fewer passwords – RSA, Section 9.5.3.
$ ssh-agent bash # or run zsh/tcsh/pdksh program instead.
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /home/osamu/.ssh/id_rsa:
Identity added: /home/osamu/.ssh/id_rsa (/home/osamu/.ssh/id_rsa)
$ scp foo [email protected]:foo
... no passphrase needed from here on :-)
$^D
... terminating ssh-agent session
For the X server, normal Debian startup scripts execute ssh-agent
as parent process. So you only need to execute ssh-add
once.
For more, read ssh-agent(1)
and ssh-add(1)
.