IT序号网

git之无法通过SSH克隆/推送

think 2026年10月29日 编程语言 46 0

例:

$ git clone git@gitlab:carlos/test.git 
Cloning into 'asd'... 
ssh: connect to host gitlab port 22: No route to host 
fatal: Could not read from remote repository. 
 
Please make sure you have the correct access rights 
and the repository exists. 

我已将IP和名称添加到主机中,但是即使直接使用IP,也会发生错误。
我可以使用root用户通过SSH登录,但它不适用于git用户。

我不知道这是怎么回事。

谢谢

请您参考如下方法:

您是否已正确配置gitlab-shell?

cd /home/git/gitlab-shell 
./bin/check 

如果API访问失败,则说明您的配置存在问题。


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!