Using ssh agent key forwarding

In: Linux

29 Nov 2006

If you have to connect to many different unix machines every day there comes the time when you are sick of entering your (hopefully) different passwords again and again.

When working with windows I use Putty and the Pageant for key forwarding (see the documentation).

On a Linux system you can do the following:

  1. Generate your personal key by entering

    ssh-keygen -t rsa

    Select default directory and enter the master password to protect your key

  2. Run the ssh agent

    eval `ssh-agent` (as background process) or
    ssh-agent bash (start bash based on ssh-agent)

  3. Load the generated key into the agent

    ssh-add

    Enter the password and the key is loaded

  4. To display your public key enter ssh-add -L
  5. Add the displayed key to the file ~/.ssh/authorized_keys on the target machine
  6. Connect to the machine – et voila – no need to enter a password anymore!

Keep the password to your key file safe!

For more details see this.

Comment Form

Follow Me!

Photostream

    P1010008 (2)P1010026P1010028P1010021P1010009 (2)P1010033 (2)

RSStOMPSON's tweets