I just installed a new instance of Gitlab on a Linux server. Everything works flawlessly so far… I created a user, I created a repo. I also enabled 2FA for the user. I need and therefore have SSH disabled.
However I am not able to push anything to the server. The git client keeps asking about username and password no matter what I supply. So I am in a loop without error messages. Of course I tried to read the documentation on that topic, but he does not take a PAT (= Personal Access Token) either. No matter whether I supply the token as username or as password (which I read about on the internet).
The “Authentication log” on the webinterface shows no errors or connection tries from my git cli.
The documentation seems to have nothing on my specific error as well.
Any ideas?
Thanks for your help in advance
Since you’ve disabled SSH and this user has 2FA enabled, you’ll need to use a Personal Access Token (PAT) for authentication. Here’s a step-by-step process on how to create and use a PAT:
Create a Personal Access Token: Log in to your GitLab account, navigate to your avatar at the top-right corner, and click “Settings.” In the left sidebar, choose “Access Tokens,” provide a name and an optional expiration date, and check the api and write_repository scopes. Click “Create personal access token” and copy the generated token.
Use the PAT for Git authentication: When Git asks for your username and password, use your GitLab username as the username, and the Personal Access Token as the password. This should allow you to authenticate.
thanks for your answer. I tried again, with a new token, but still the same error as mentioned above. Git simply keeps asking for username and password, as if I had entered nothing.
What I eventually found was that I was getting the 2FA message regardless of what I did, even when 2FA was disabled. Turns out, I needed to bypass the corporate proxy by adding an environment variable for no_proxy with the URL of my GitLab endpoint.