简体   繁体   English

无法通过git服务器上的ssh“连接”到新存储库

[英]Can't “connect” to new repos via ssh on a git server

I have some repos on a local server which I access over ssh and with git. 我在通过ssh和git访问的本地服务器上有一些存储库。 I have one repo created whic I can operate, the problem appears when I try to create a new repo and operate. 我已经创建了一个可以操作的存储库,但是当我尝试创建一个新的存储库并运行时出现了问题。

I push something on an already created repo: code 我在已经创建的仓库中推送一些东西: 代码

And when I create a new repo on the same folder on the server. 当我在服务器上的同一文件夹上创建新的仓库时。 code

Ok now all went well, the problem comes now, when I try to push some file there: code 好的,现在一切顺利,当我尝试将某些文件推送到此处时,问题就来了: 代码

It stucks there and no longer finishes. 它卡在那里,不再完成。

I've already tried to regen ssh rsa keys but I doubt it's the problem due to I can push from another repo... 我已经尝试过重新生成ssh rsa密钥,但是我怀疑这是问题所在,因为我可以从另一个存储库中推送...

I was creating the repo in the root user not the git user. 我是在root用户而不是git用户中创建回购协议。

Yes, your first screenshot shows a working push, meaning Git looks and find the private/public keys in /home/git/.ssh 是的,您的第一个屏幕截图显示了有效的推送,这意味着Git可以在/home/git/.ssh查找并找到私钥/公钥。

You would need a /root/.ssh/config file in order to specify in it the path of the private key to use, if you wanted for root to reuse the same credentials. 如果您想让root重用相同的凭据,则需要一个/root/.ssh/config文件,以便在其中指定要使用的私钥的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM