0

~/.bashrc

if [ -z "$SSH_AUTH_SOCK" ] ; then
  # This doesn't work
  echo 'my_passphrase' | eval `ssh-agent -s`
  ssh-add
fi

When I run a terminal, I see this error 3 times Could not open a connection to your authentication agent., and when I try to connect to my remote server through ssh, I'm asked to enter my passphrase.

How do I make it work?

smarber
  • 4,829
  • 7
  • 37
  • 78
  • 1
    Generate another key pair without a passphrase – Ed Heal Feb 03 '17 at 09:32
  • Can't because adding my new public ssh key to the remote server will take at least three days :/. – smarber Feb 03 '17 at 09:36
  • Can you just sftp it to the remote server? – Ed Heal Feb 03 '17 at 09:38
  • Yeah I can do that for almost all server except the ldap server unfortunately – smarber Feb 03 '17 at 09:42
  • Log into the remote server. Run stfp client on that and connect to your local machine. Surely you can fire up a SFTP server on that – Ed Heal Feb 03 '17 at 09:43
  • http://stackoverflow.com/questions/112396/how-do-i-remove-the-passphrase-for-the-ssh-key-without-having-to-create-a-new-ke – Ed Heal Feb 03 '17 at 10:08
  • I'd recommend the use of a keychain program that runs when you log in and automatically populates your `ssh-agent`. – chepner Feb 03 '17 at 12:43
  • sounds like your agent is either not running or your SSH_AUTH_SOCK is not set. in my .profile i have "export SSH_AUTH_SOCK=$HOME/.ssh-socket " and after that, i have "ssh-agent -a $SSH_AUTH_SOCK" and it will prompt me for the passphrase for any keys stored in $home/MYID/.ssh . I would be careful with trying to store your passphrase in a script as it is very insecure – General Foch Feb 03 '17 at 15:14

0 Answers0