AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 124607
Accepted
user38316
user38316
Asked: 2010-03-21 11:51:49 +0800 CST2010-03-21 11:51:49 +0800 CST 2010-03-21 11:51:49 +0800 CST

无法从运行 gitosis 的雪豹服务器本地克隆 gitosis-admin.git

  • 772

我已经按照此处所述安装了 gitosis:http: //gist.github.com/264304

我必须调整的一件事是授予我的 git 用户使用 ssh 的权限(我通过服务器管理员 -> 访问 -> ssh 并添加了“git”用户)。

当我以 git 用户身份从本地计算机 (mac osx) 进行 ssh 时,我收到以下响应:

PTY allocation request failed on channel 0
bash: gitosis-serve: command not found
                                      Connection to 10.0.0.108 closed.

我认为这是正常的,因为在 Pro GIT 中,作者说如果你尝试使用你的 git 用户 ssh 到服务器,你应该得到这样的东西:

PTY allocation request failed on channel 0
fatal: unrecognized command 'gitosis-serve schacon@quaternion'
  Connection to gitserver closed.

到目前为止一切顺利,我想?现在,当我尝试使用以下命令克隆我的 gitosis-admin.git 存储库时:

$git clone [email protected]:gitosis-admin.git

我明白了:

Initialized empty Git repository in /Users/joggink/gitosis-admin/.git/
bash: gitosis-serve: command not found
fatal: The remote end hung up unexpectedly

所以在做了一些搜索之后,我在 serverfault 上找到了一个答案,声称我应该使用 ssh:// 作为我的 git clone 的协议(我认为这是默认的 git 协议?)但是,当我尝试时:

$git clone ssh://[email protected]:gitosis-admin.git

这是回应:

The authenticity of host ' (::1)' can't be established.
RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Password:
Password:
Password:
Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly

当我输入自己的密码时(因为我的 git 用户没有密码),我收到以下错误:

The authenticity of host ' (::1)' can't be established.
RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Password:
bash: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly

我添加了我的上传包位置,如下所示:

$git clone -u /usr/local/git/bin/git-upload-pack ssh://[email protected]:gitosis-admin.git

我收到 gitosis-admin.git 不是 git repo 的错误...

Initialized empty Git repository in /Users/joggink/gitosis-admin/.git/
The authenticity of host ' (::1)' can't be established.
RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Password:
fatal: '[email protected]:gitosis-admin.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

我一直在寻找一个近一周的解决方案,我在互联网上找到的每个主题都没有结果......

git osx-snow-leopard
  • 3 3 个回答
  • 10431 Views

3 个回答

  • Voted
  1. Best Answer
    Peter
    2010-03-26T05:36:05+08:002010-03-26T05:36:05+08:00

    我总是遇到同样的问题,找出原因有点棘手。我尝试通过 IP 交换服务器名称:

    git clone git@frontend1:gitosis-admin.git

    经过

    git clone [email protected]:gitosis-admin.git

    并得到了 gitosis-serve 未找到的消息,即使用 .ssh/authorized_keys 调用 gitosis-serve 时不包含 /usr/local/bin 路径。

    因此,在文件~git/.ssh/authorized_keys(作为管理员)中,我将gitosis-serve 替换为/usr/local/bin/gitosis-serve,即全路径名。之后,命令

    git clone git@frontend1:gitosis-admin.git

    工作正常。

    • 2
  2. user59164
    2010-11-05T01:03:42+08:002010-11-05T01:03:42+08:00

    尝试将 git 用户 shell 从 git-shell 更改为 sh
    例如:
    从
    git:x:1000:1000::/home/git:/usr/bin/git-shell
    到
    git:x:1000:1000::/home /git:/bin/sh

    这对我有帮助。

    • 0
  3. bjcubsfan
    2011-06-23T13:16:33+08:002011-06-23T13:16:33+08:00

    尝试在 Ubuntu Linux 10.04 (lucid lynx) 上安装 gitosis 时遇到了同样的问题。我卸载了 gitosis,删除了主目录(对我来说是 /srv/gitosis/)并重新启动了Ubuntu 社区 git 页面上的说明。当我到达那一步时,问题没有再次出现。

    • 0

相关问题

  • 如何使用 Gitosis 删除 Git 存储库

  • Git 和 Mercurial

  • 如何修复 git 中第一次提交的元信息?

  • 如何编辑 git 的历史记录以更正不正确的电子邮件地址/名称 [关闭]

  • git如何控制访问权限

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve