samuel toh
samuel toh

Reputation: 7076

How to solve Access denied in gitlab?

When I run : git push, there is exist error like this :

remote: Access denied
fatal: unable to access 'https://gitlab.com/myname/mysystem.git/': The requested URL returned error: 403

Is there any people who can help me?

Upvotes: 27

Views: 100794

Answers (10)

shailendra patel
shailendra patel

Reputation: 11

check how to generate new password and try below

you can type in cmd

  • git pull

Username for 'https://gitlab.XXX.xx': XXXX Password for 'https://[email protected]': here u can enter new token or try this one also

  1. Go to "control panel"
  2. user accounts -manage credentials
  3. windows credentials
  4. git:https://[email protected]
  5. click on down
  6. arrow Click remove. and add new token

Upvotes: 1

Andy
Andy

Reputation: 161

For anyone who is getting this error also on non-Windows platforms with GitLab 13+. There is another reason for this error apart from invalid credentials in your credential manager.

I had a problem where my account was using LDAP for authentication but still had a password expiration date set. Because the server was configured to use LDAP authentication only, the password expiration was not visible in the web UI and became only an issue after GitLab published a security fix with version 13.12.2.

You can check and edit the password_expires_at attribute of a user account via the GitLab Rails Console. Setting it to nil solved the issue for me and got the LDAP authentication working again.

Upvotes: 0

Udaiyappan Vellaisamy
Udaiyappan Vellaisamy

Reputation: 51

Basic Authentication / Access Denied issue fix:

  1. Open Terminal from respect tool (Ex: Source Tree)

  2. Execute this command --> git config --global credential.helper store

  3. Execute this command --> git pull

    i) provide your user name 2) provide your password

Upvotes: 5

Coffee and Code
Coffee and Code

Reputation: 1033

This happened to me today. First was a blue screen of death in Windows 10 (I'm using git for windows connecting to a Azure DevOps repo), so after a restart, I was able to run git status and git diff both were fine, and then git add . that was also fine. When I got to git push I got an error unable to access.

I had cloned the repo and used the supplied git credentials initially and didn't have to enter any more credentials. So, I tried git remote -v and it listed the remote repo. After this I tried git push again, and It worked. An easy one to try before you go more difficult routes.

Upvotes: 0

Keshav Gera
Keshav Gera

Reputation: 11244

For Windows User

Go to Control Panel->Credential Manager->Windows Credentials select github or gitlab credentials and modify it. This is for windows10

enter image description here

Update your credentials again

and add access token here

https://gitlab.com/profile/personal_access_tokens

Upvotes: 14

gust
gust

Reputation: 945

Very late here, but for posterity's sake:

If you do not have a gitlab password (initially signed up through github or something), then this will fail. You will just need to go to the page and create a password. At least that worked for me.

Upvotes: 0

mpro
mpro

Reputation: 15050

For Windows users, check this unbelievable easy 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.

Upvotes: 21

Mahdi Abdi
Mahdi Abdi

Reputation: 692

if you made your account by signing in with Github or Bitbucket, etc. add a password to your account so you can push, pull and clone with Gitlab.

Upvotes: 0

serv-inc
serv-inc

Reputation: 38187

What might help is

git config --system --unset credential.helper

then enter new password for Git remote server.

Upvotes: 6

afxentios
afxentios

Reputation: 2568

You need to add an SSH key to your GitLab and make sure git is using that key.

You can find this documentation helpful.

Upvotes: 8

Related Questions