1

I cannot access to my repo with ssh keys. When I'm trying git push to my rep on gitlab it asks passphrase.

My steps from scratch. Im going to ~/.ssh/ and rm all files inside this folder. Then:

  1. Create ssh key ssh-keygen -o -t rsa -C "mymail@gmail.com" -b 4096

  2. then inside ~/.ssh/ pbcopy < id_rsa.pub

  3. then in gitlab account profile > settings > ssh keys. I put my key and press add key button.

  4. then back to terminal and type ssh gitlab.com and got

Enter passphrase for key '/Users/local/.ssh/id_rsa'

If I enter a password it works, but this is not an expected result. How to establish proper ssh connection to gitlab using ssh? And what am I doing wrong?

  • 2
    While creating the public keys using `ssh-keygen`, when prompted for a passphrase, just press enter. Don't provide a passphrase if you don't want to be asked for one. This explains why things work when you enter your passphrase. – Pavan Manjunath Oct 02 '18 at 22:53

1 Answers1

0

If you must use a passphrase, you must add your private key to the ssh-agent in order to not enter that passphrase every time you will use the SSH URL.

But you can also remove the passphrase from your existing private key (with ssh-keygen -p).
Nothing needs to change on the GitLab side (where your public key is safely registered to your account)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250