Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to clone repository from Gitlab: Permission denied, please try again

I'm trying to clone an empty repository from my Gitlab account. I simply use the address shown on my Gitlab repository page under SSH:

[email protected]:USERNAME/project-name.git

enter image description here

Then simply try this in an empty folder, but it keeps telling me permission denided, asking for retry:

git clone [email protected]:USERNAME/project-name.git
Cloning into 'project-name'...
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:

and when I choose the https address for clone, this is the message:

remote: HTTP Basic: Access denied
fatal: Authentication failed for ....

I am able to login to Gitlab homepage with that password, so I don't know what is really wrong.

What is wrong? How to fix it?

like image 501
Tina J Avatar asked Nov 14 '18 15:11

Tina J


People also ask

Why do I get permission denied Publickey?

"Permission denied (publickey)" and "Authentication failed, permission denied" errors occur if: You're trying to connect using the wrong user name for your AMI. The file permissions within the operating system are incorrect on the instance. The incorrect SSH public key (.

How do you please make sure you have the correct access rights and the repository exists?

The “Please make sure you have the correct access rights” error occurs if you do not have the right permissions to access a Git repository. To solve this error, make sure you are referring to the correct remote URL and that you have set up SSH authentication correctly.


2 Answers

ssh authentication on Gitlab requires a ssh key. You need to generate one, depending on your host, windows, linux or other. Then you need to add the key to your account.

You can find all the required information here: https://gitlab.com/help/ssh/README.md

If you want to use your http login you should switch to http authentication. At the left of the repository address there's a menu, you can choose ssh or http. Use the latter

like image 21
ErniBrown Avatar answered Oct 04 '22 09:10

ErniBrown


As I'm in Windows, this answer was the life saver:

It happen every time I'm forced to change the Windows password and none of above answers helped to me.

Try below solution which works for me:

Go to Windows Credential Manager (press Windows Key and type credential) to edit the git entry under Windows Credentials. Replace old password with the new one.

like image 86
Tina J Avatar answered Oct 04 '22 07:10

Tina J