从一台机器访问不同的Gitlab服务器

从一台机器访问不同的Gitlab服务器

问题描述:

  • 从家访问公司的gitlab - >没问题。
  • 现在尝试访问家中的第二台gitlab服务器(在Raspberry Pi上) - >询问密码和访问被拒绝。
  • 服务器似乎运行得很好,可以访问Web界面,配置它,添加用户,组和项目。

我做了一个新的SSH密钥(除了我用来访问公司的gitlab服务器之外),将它添加到ssh配置文件中,并将它放到我的配置文件中的gitlab服务器上。 (我希望使用另一个这台服务器!)从一台机器访问不同的Gitlab服务器

我也改变了git全局配置用户和电子邮件,但这也没有帮助。

这就是我所做的,并得到:

  • 我试图克隆我的测试项目在bash:

    git clone [email protected]:testgroup/TestProject.git

我得到的是这样的:

Cloning into 'TestProject'... 
Warning: Permanently added the ECDSA host key for IP address 'bladibla IP6 address here' to the list of known hosts. 
[email protected]'s password: 
Permission denied, please try again. 
[email protected]'s password: 

(If你需要更多的信息,请告诉我。)

+0

验证'ssh -vvv git @ rpgl'表示ssh正在使用正确的密钥。有关ssh配置和调试的详细信息,请参阅https://stackoverflow.com/q/1595848/7976758。 – phd

确保您~/.ssh/config引用正确的SSH私钥,正如我在提到“What steps must I take to consistently push to two Github accounts using SSH?

你远程的Git URL应该然后是

anHostEntry:auser/arepo.git 
+0

好吧,我花了一段时间,但在按照你的解释并删除我的ssh密钥并创建新密钥之后,我终于开始工作了。非常感谢! – antx