For Unix, what are ssh-agent and ssh-add, and how do I use them?
In Unix, ssh-agent is a background program
that handles passwords for SSH private keys. The
ssh-add command prompts the user for a private key password
and adds it to the list maintained by ssh-agent. Once
you add a password to ssh-agent, you will not be
prompted for it when using SSH or scp to connect to hosts
with your public key.
To use ssh-agent and ssh-add, follow the steps below:
- At the Unix prompt, enter:
eval `ssh-agent`
Note: Make sure you use the backquote
(
`), located under the tilde (~), rather than the single quote (').
- Enter the command: ssh-add
- Enter your private key password.
- When you log out, enter the command:
kill $SSH_AGENT_PID
To run this command automatically when you log out, place it in your
.logoutfile (if you are usingcshortcsh) or your.bash_logoutfile (if you are usingbash).
Note: The versions of these programs for
SSH2, ssh-agent2 and ssh-add2,
are the same as outlined above. To use them, follow the instructions
above, replacing all
occurrences of ssh-agent with
ssh-agent2 , and ssh-add with
ssh-add2 . The SSH2 versions will only work if both
your computer and the remote host are running SSH2.
Also see:
- In SSH and SSH2 for Unix, how do I set up public key authentication?
- In Unix, how do I use the scp command to securely transfer files between two computers?
This is document aeww in domain all.
Last modified on July 30, 2004.
Last modified on July 30, 2004.
Please tell us, did you find the answer to your question?






