Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

20.7.3.5. Configuring ssh-agent

The ssh-agent can be used to store your passphrase so that you do not have to enter it each time you make a ssh or scp connection. If you are not running the X Window System, follow these steps from a shell prompt. If you are running GNOME but you do not want to configure it to prompt you for your passphrase when you log in (refer to Section 20.7.3.4, “Configuring ssh-agent with a GUI”), this procedure will work in a terminal window, such as an XTerm. If you are running X but not GNOME, this procedure will work in a terminal window. However, your passphrase will only be remembered for that terminal window; it is not a global setting.
  1. At a shell prompt, type the following command:
    exec /usr/bin/ssh-agent $SHELL
  2. Then type the command:
    ssh-add
    and enter your passphrase(s). If you have more than one key pair configured, you will be prompted for each one.
  3. When you log out, your passphrase(s) will be forgotten. You must execute these two commands each time you log in to a virtual console or open a terminal window.