I have tried anything I can think of and find online by this point to get it to work but nothing I have tried works.
I am using Windows 10. I already have a repository on GitLab and an SSH-key assigned. And I just want to clone/push/pull the normal stuff.
When I do ssh -Tv [email protected]
I get;
Welcome to GitLab, @user!
.
But when I try to clone the repo using
git clone [email protected]:user/my-repo.git
I get;
[email protected]: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
This is my config in .ssh, saw some people solving their problem by doing this.
Host gitlab.com
User git
Hostname gitlab.com
IdentityFile ~/.ssh/id_ed25519
Preferredauthentications publickey
TCPKeepAlive yes
IdentitiesOnly yes
I have also tried using the GitLab Personal token with GitLab workflow on vsc and I can see the repo when I use the menu under Git Clone > Clone from GitLab > user/my-repo
.
I can also Open remote repo using the GitLab workflow on vsc, and I can see my code.
When trying to clone the repo using
git clone https://gitlab.com/user/my-repo.git
I get;
remote: HTTP Basic: Access denied
remote: You must use a personal access token with 'read_repository' or 'write_repository' scope for Git over HTTP.
remote: You can generate one at https://gitlab.com/-/profile/personal_access_tokens
fatal: Authentication failed for 'https://gitlab.com/user/my-repo.git/'
I have remade the ssh keys multiple times both rsa and ed25519, I have removed and added a new personal token nothing works.
Does anyone have had the same problems? How did you solve it? I've seen
I have replaced my username and repo name with user and my-repo.
CodePudding user response:
Since ssh -Tv [email protected]
recognizes you as a user that means you set up the keys correctly.
I would recommend checking at your Gitlab repository GUI. Click Clone
In order to make sure that there isn't any typo with git clone command. E.g. if your repo name has spaces
, that would be a common error source.
CodePudding user response:
I found a solution that works but ssh still is broken, when using the Personal Token, when it asks you to input username and password input the token instead of the password.