git - 如何将其他用户(windows)添加到gitosis

标签 git gitosis

我刚刚使用 gitosis 设置了一个 git 存储库。我不知道的是如何添加其他用户。我找到的所有教程都只说“收集他们的公共(public) SSH key ”。

首先,我尝试在我的机器(而不是服务器)上本地创建,但我觉得这是错误的方法。
现在我尝试在 Windows 机器上使用 PuTTy keygen 创建公钥,保存 key 并将其放入 gitosis-admin 目录下的 keydir。
我都试过了 git clone git@cn-linuxdev.****.***:tungsten.gitgit clone tor@cn-linuxdev.****.***:tungsten.git其中 tor 是 keydir 中文件的名称。

auth.log 中产生的错误是Failed password for git from 192.168.0.158 port 63305 ssh2

在 Windows 客户端中,我还尝试了在设置过程中设置的密码 sudo -H -u git gitosis-init < /tmp/id_rsa.pub .
此 ssh key 来 self 的本地计算机。这个密码在那里有效,但不适用于 Windows 客户端。

我不太明白 ssh key 是如何工作的,但我猜它们以某种方式绑定(bind)到生成它们的计算机上。

那么有没有人设法与其他用户和 Windows 用户一起设置 gitosis?你是如何让它发挥作用的?

最佳答案

每个用户都应该生成他/她自己的一对公共(public)和私有(private) ssh key 。

查看此 GitHub help page .
然后他们需要向您发送他们的 $HOME/.ssh/id_rsa.pub 的内容给您 to call gitosis-init with 适本地编辑配置文件并 checkin (并推送)keydir/..
中的 key (谢谢 ebneter 指正)。
例如,在这个 mantisbt gitosis management page 中:

$ cat > keydir/jsmith.pub
...
^D

$ git add gitosis.conf keydir/jsmith.pub
$ git commit -m "Added 'myplugin' repository and 'jsmith' user."

$ git pull --rebase    # make sure we have the latest updates from the server
$ git push

注意:所有用户端操作(如 ssh-keygen -t rsa -C "my@email.com"$HOME/.ssh/id_rsa.pub ) 需要在 Git bash 环境中完成或评估,而不是在 Dos shell 中。

关于git - 如何将其他用户(windows)添加到gitosis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3760255/

相关文章:

git - 在 Git 中 checkout 分支

Tomcat 用户未使用 Jenkins 和 Gitosis 正确中继 SSH key

Git 一直要求输入密码

git - 如果不是最新的,则防止 git push 发送整个 repo

Gitignore 双星模式不起作用

git - 在多个分支中处理对 Jenkinsfile 的常见更新

git - 有没有一种简单的方法可以知道哪些文件将在下一个 'git pull' 中更新?

git - merge 后哪个提交是 HEAD^,为什么不是正确的提交

gitosis 和 git clone 问题

git - 连接 gitosis 服务器时出现问题