I'm trying to use a newly generated elliptic curve key with git version control for GitLab.

  • I am using a Xubuntu 16.04.
  • My OpenSSH version is: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016

Usually I would do:

ssh-add -D  # to be sure no other identities are used than the one I add
ssh-add ~/.ssh/my-rsa-key
git add ...
git commit ...
git push ...

Then the key ring thing would again ask for the password of the key to store it for the session and I could push and pull without needing to add any key again or entering the password again.

However with elliptic curve keys it does not seem to work. First of all, I cannot ssh-add the key:

ssh-add ~/.ssh/id_ed25519
Enter passphrase for /home/user/.ssh/id_ed25519:  # here I enter my password
Could not add identity "/home/user/.ssh/id_ed25519": communication with agent failed

However, when I did not remove all identities and did not use ssh-add <key> and cancelled entering a password for the key ring for other (rsa) keys, I was asked to enter the password for the elliptic curve key on command line and when I entered it there, I could push to or pull from my repository. The problem then is, that I have to enter my password on every interaction with gitlab and my repository. So I tried configuring my ~/ssh/config to not prompt for password all the time:

Host gitlab.com
  User "user"
  PreferredAuthentications publickey,password
  IdentityFile /home/user/.ssh/id_ed25519
  IdentitiesOnly yes
  AddKeysToAgent yes

But that does not work either, it keeps nagging me about the password on every pull or push.

How can I add the keys like I do with RSA keys, so that I do not have to enter the password all the time?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.