git - 了解 Gitosis 用户存储库访问

标签 git ubuntu ssh gitosis

我已经在我的 Ubuntu 虚拟服务器上设置了 gitgitosis。在服务器上创建新的存储库,检查 gitosis-admin.git 并推送更改后的conf和新 key (例如,otheruser.pub)可以正常工作。 authorized_keys 文件也会更新。但现在我陷入困境了。

如果我尝试使用不同的用户将现有(区域设置机器)存储库推送到 myserver.com 上的裸存储库,那么“git”则不会工作。

示例(SSH):

<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="caada3be8aa7b3b9afb8bcafb8e4a9a5a7" rel="noreferrer noopener nofollow">[email protected]</a>:/my/path/to/xyzrepo.git 

有效,但是

<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2adb6aaa7b0b7b1a7b082afbbb1a7b0b4a7b0eca1adaf" rel="noreferrer noopener nofollow">[email protected]</a>:/my/path/to/xyzrepo.git 

不……

我假设 gitosis 在机器上创建临时用户或类似的东西。这是正确的吗?

最佳答案

使用 gitosis,您始终使用相同的用户 ID (git@...)。您是通过您使用的 ssh key 来识别的。您会注意到商业 Git 托管服务,例如 GitHubGitorious以同样的方式工作。

我想强调 djs 的评论:您不应该能够使用密码登录 git 用户帐户。 Gitosis 依赖 ssh authorized_keys 文件才能正确运行,并且仅当有人使用 ssh key 进行身份验证时才会使用它。

关于git - 了解 Gitosis 用户存储库访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10760021/

相关文章:

git - 用标签固定分离的头

ubuntu - 脚本卡在 LXC 初始化任务中

linux - 无密码 ssh 有效但不适用于 Hadoop

bash - 为什么 bash(来自 git 安装)突然给我段错误?

git - 过滤存储库时如何保留标签?

R:Ubuntu中的包安装问题

ubuntu - 交叉编译ROS Melodic on RaspberryPi 3B+问题

git - 无法使用部署 key (bitbucket) EC2 进行克隆

regex - Fail2ban 规则不起作用

git - 如何从 tmux.conf 导出函数