ssh agent
To use ssh(1)
we first need to start ssh-agent(1)
. We use -c
to generate C-shell commands on stdout for csh-style shells and -s
for Bourne-shell.
eval `ssh-agent -c`
With ssh-agent running we need to ssh-add(1)
our private key that we want to use.
ssh-add ~/.ssh/<your_private_key>
That's it, ssh-agent
will now hold that private key and use it for public key authentication.
You can list all identities currently represented by the agent with the ssh-agent -l
command.
To set this up automatically on login, just add these commands to your shell configuration file.
As an example, for tcsh(1)
use ~/.tcshrc
.