Vagner Wentz
Vagner Wentz

Reputation: 566

fatal: Authentication failed when trying to clone GitLab project even though "ssh -i" command prints "Welcome to GitLab, [username]"

I cannot clone the project although

ssh -T [email protected]

shows what I want: Welcome to GitLab, @vagnerwentz!.

The error during cloning:

Cloning into 'jobfygo'...
Username for 'https://gitlab.com': vagnerwentz
Password for 'https://[email protected]': 
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.com/jobfy/backend/jobfygo.git/'

Upvotes: 4

Views: 709

Answers (2)

VonC
VonC

Reputation: 1329112

First, you are cloning with an HTTPS URL, which means all your SSH settings is for naught.

Second, regarding HTTPS, double-check if you have 2FA activated, because if you do, your password would actually be a PAT (Personal Access Token)

Third, if you do want to use SSH, then use the SSH URL:

[email protected]:jobfy/backend/jobfygo.git

By default, such an url would use the default private SSH key ~/.ssh/id_rsa. So if you have a key with another name, you would need to:

  • either rename it to id_rsa
  • specify it directly ssh -i /path/to/second/private/key
  • use a ~/.ssh/config file

Upvotes: 2

Vagner Wentz
Vagner Wentz

Reputation: 566

I resolved changing the SSH Key to RSA Key.

Upvotes: 2

Related Questions