SSH key authentication still asks for credentials

Hi,

I’m a long-time Github user currently migrating to Gitlab. I’d like to configure SSH key authentication so I don’t have to type in my username and password every time. So far I have a partial success. Here’s what I did so far.

My workstation is running Linux (OpenSUSE Leap 15.1). My main user is kikinovak. I’m already using SSH key authentication for all my remote servers.

[kikinovak@alphamule:~] $ tree ~/.ssh/
/home/kikinovak/.ssh/
├── id_rsa
├── id_rsa.pub
└── known_hosts

0 directories, 3 files

I copied/pasted my public key to Gitlab. The test seems to work:

[kikinovak@alphamule:~] $ ssh -T git@gitlab.com
Welcome to GitLab, @kikinovak!

But when I try to fetch my dummy test repository from Gitlab, I’m still getting asked for credentials:

[kikinovak@alphamule:~] $ git clone https://gitlab.com/kikinovak/toto
Clonage dans 'toto'...
Username for 'https://gitlab.com': 

What am I doing wrong here?

Cheers from the sunny South of France.

did you get this resolved?

Well, if you add an SSH key, it isn’t going to work over HTTPS like they tried above. If you want to clone via SSH:

git clone git@gitlab.com/kikinovak/toto

since that is when SSH will be used, and therefore the SSH key uploaded to the account. If you want to use HTTPS, then you need to pass the username and better personal token to pass through instead of password obviously. Then it would be:

git clone https://username:token@gitlab.com/kikinovak/toto

so it’s just a question of how you want to clone, SSH or HTTPS.