【问题标题】:Push to Gitlab returns fatal推送到 Gitlab 返回致命
【发布时间】:2013-01-17 14:52:46
【问题描述】:

使用全新的 Gitlab 安装,生成 SSH 密钥并将其添加到用户帐户,创建了一个新项目。

从本地计算机创建一 (1) 个文件夹,添加自述文件并从终端执行以下操作:

git init
git add README
git commit -m '1_16_2013' 
git remote add origin git@192.168.1.55:root/test.git 
git push -v origin master

推送询问 git@192.168.1.55 的密码并返回:

Connection closed by 192.168.1.55
fatal: The remote end hung up unexpectedly

我需要在本地机器上添加一个 shh 密钥吗?

【问题讨论】:

    标签: ssh-keys gitlab


    【解决方案1】:

    您需要将公钥和私钥(id_rsaid_rda.pub)存储在本地计算机的 ~/.ssh 目录中。
    否则,任何到 gitlab 服务器的 ssh 都会要求输入密码。

    你还需要使用正确的ssh地址:

    git@192.168.1.55:test.git
    

    您不应该在 git repo 的名称前有任何路径:gitolite(由 GitLab 使用)将检测 repo 的名称并使用正确的 repo 路径。

    我更喜欢将此信息(服务器名称、ssh 用户、私钥...)存储在 ~/.ssh/config 文件中:请参阅“gitolite: can connect via ssh, can't clone”作为示例(或“git clone git@myserver:gitolite-admin fails”)。

    【讨论】:

    • 明白。将公钥和私钥添加到本地机器的 ~/.ssh 目录中。我可以推送到 Gitlab,但我一直在运行,但我一直在运行,收到“致命:W any test admin_local_host DENIED by fallthru (or you mispelled the reponame)”的响应。
    • @Harrison 查看 gitolite 日志。那里可能有更多信息。
    • 是的,看起来我需要推送到完整路径。 git@192.168.1.55:root/test.git 我是否需要更新一些东西以避免使用完整路径?
    • @Harrison 使用完整路径推送对于 gitolite 来说绝不是一个好主意:这通常表明您正在绕过 gitolite 检查 (sitaramc.github.com/gitolite/emergencies.html#ce)。所以你的初始路径很好,但你的 gitolite.conf 以某种方式拒绝了推送。
    • 另外...如果您有加密的主目录...您可能必须将其移动到未加密的位置。即 /etc/ssh/username/.ssh/authorized_keys 允许在您未登录时访问它
    猜你喜欢
    • 2015-03-15
    • 2014-01-22
    • 1970-01-01
    • 2014-05-26
    • 2019-06-03
    相关资源
    最近更新 更多