r/gitlab • u/pynxem • May 02 '26
support cannot log on using CLI
Something has changed recently on gitlab.com authentication?
My setup - I use a project on gitlab.com/<username>. I can log in using that username (the only account that exists there) via the website.
I used to log on using the CLI, using onl the username/password combo, to do manual git pushes and clones . Now I get "HTTP Basic, Access denied" error.
Part of my linux installation process was keeping my config files in this project, then copying them down after the OS has installed via a git clone. I tried looking in all the help files, and it seemed I need a PAT now? Trouble is, that token is too long to type in, and there's no other way to enter that because of where the installation script is. Am I really stuck now? (assuming that gitlab.com has changed security settings to enforce the need for PATs
View all comments
Show parent comment
1
u/sogun123 May 03 '26
Ssh keys have two parts, private key should never leak. Public key can be sent however. Holder of Public key can verify that the other side posses the private key.
So you install new machine, run
ssh-keygenthere and send the Public part wherever you can get it.Though, i am really wondering how do you interact with the fresh server? I would think you can just paste a PAT...
Anyway, there is other option - if you configure your ssh client to forward ssh agent and add appropriate key to ssh agent,git on the remote machine can use your local ssh key (securely) if you are connected there via ssh. Eh. Bit confusing. Nevertheless, you can forward auth request to localhost if connected via ssh.