Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab ssh is enabled but no longer allows clone/push/etc

Tags:

git

ssh

gitlab

I was able to push to GitLab via SSH until recently. We changed a number of configuration things so I'm having issues sorting out what the issue is. The biggest changes are I'm now on a VPN, the project changed owners, and IPs were restricted. I have a feeling it's something to do with the IP restrictions.

ssh -T [email protected] prints Welcome to GitLab, @myUsername! so the ssh connection is working.

However if I attempt to clone, push, etc. it fails with various errors (added below) but ultimately says Please make sure you have the correct access rights and the repository exists.

I've tried various things (added below), primarily modifying the remote to use my username in various capacities based on other answers I found. None of them work. I am able to push/clone via https.

Is there an IP I need to allow or some other config in gitlab I need to set?

Some of the things I've tried:

git remote add origin [email protected]:companyName/projectName.git

git remote add origin [email protected]:companyName/projectName.git

git remote add origin [email protected]:companyName/projectName.git

And their corresponding errors:

ssh: Could not resolve hostname myUsername.gitlab.com: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
remote: 
remote: ========================================================================
remote: 
remote: The project you were looking for could not be found.
remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[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.
like image 207
Bix Avatar asked Jun 28 '26 21:06

Bix


1 Answers

Suggestions:

  • Double-check your repository's configuration: https://docs.gitlab.com/ee/ssh/README.html#testing-that-everything-is-set-up-correctly
  • Configure your repository for HTTPS authentication https://forum.gitlab.com/t/could-not-read-from-remote-repository-from-gitlab-com/7508/2
  • Enable GitLab verbose logging: docs.gitlab.com/ee/administration/logs.html
like image 129
paulsm4 Avatar answered Jun 30 '26 13:06

paulsm4