Setting up password-less authentication with OpenSSH
With the default key file
- The first step is to generate a private and a public key on the guest computer. I will issue the following command to generate an RSA key. I could use -t dsa to generate a DSA private key.
ssh-keygen -t rsa- Now, I have two files in the
~/.sshdirectory of my guest computer: id_rsa and id_rsa.pub - I will now copy it to my host server with the OpenSSH scp command:
$ scp ~/.ssh/id_rsa.pub username@hostname:/home/username/.ssh/myguest_id_rsa.pub- On the host, I will now add the contents of the key to the list of authorized keys:
$ cat myguest_id_rsa.pub >> ~/.ssh/authorized_keys$ rm myguest_id_rsa.pub- For better security, let’s set the proper rights on the authorized_keys file. 600 means that the owner only can read and write.
$ chmod 600 authorized_keys
http://stackoverflow.com/questions/3466626/add-private-key-permanently-with-ssh-add-on-ubuntu/4246809#4246809
Error: Agent admitted failure to sign
This error appears to only occur on Linux systems. For more details, see this issue report.
If your key does not have the default filename, you'll have to pass the path to
ssh -vT git@github.com # ... # Agent admitted failure to sign using the key. # debug1: No more authentication methods to try. # Permission denied (publickey).
Resolution
For most users, simply runningssh-add to load your keys into the SSH agent will fix this issue.
ssh-agent bash
ssh-add
# Enter passphrase for /home/you/.ssh/id_rsa: [tippy tap] # Identity added: /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)
If your key does not have the default filename, you'll have to pass the path to
ssh-add
ssh-add ~/.ssh/my_other_key # Enter passphrase for /home/you/.ssh/my_other_key: [tappity tap tap] # Identity added: /home/you/.ssh/my_other_key (/home/you/.ssh/my_other_key)