我正在尝试使用多个 svn 作者作为单个托管 ssh 帐户。我遵循 http://svn.apache.org/repos/asf/subversion/trunk/notes/ssh-tricks
中的技巧对于隧道用户,但它仍然显示与我的托管 ssh 帐户用户名相同的作者。我还检查了 SVN 版本必须更新到 1.0.x 才能使其适用于隧道用户。
更新
我遵循的内容:
- 首先,我从我的托管帐户
id_rsa
获取了 key - 然后我用了
PuttyGen
导入并提取私钥。 - 之后我创建了一个
session
在 Putty 中,我完成了 域名(.com/.net 等)并在 SSH->AUTH 中附加私钥 我在data
中添加了我的托管帐户用户名用于自动登录。 - 为了进行验证,我检查了 session ,并且无需询问即可正常工作 任何密码。
- 现在我创建了我的
id_rsa
的副本输入~/.ssh
目录为authorized_keys
这是svnserve
所要求的 - 然后我添加了一行
command="~/bin/svnserve -t -r ~/svn --tunnel-user=makki",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa AAfagd..... <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a4c9c5cfcfcde4c0cbc9c5cdca8ac7cbc9" rel="noreferrer noopener nofollow">[email protected]</a>
- 现在,一切准备就绪后,我在服务器上创建了一个存储库
svnadmin create myrepo
- 我通过
svn+ssh://mydomain.com/home/svn/myrepo
结账和它 成功 checkout 但是现在当我提交时它显示作者是我的 ssh 帐户不存在makki
正如我在附加的行中提到的 在authorized_keys
文件。
请指导我在流程中缺少的内容...
authorized_keys 内容
第 1 行 ssh-rsa AAAAB3.......
line#2 command="~/bin/svnserve -t -r ~/svn --tunnel-user=makki",无端口转发,无代理转发,无X11转发,无-pty ssh-rsa AAAAB3NzaC1yc2E.....
最佳答案
如果它不起作用,您的命令中一定缺少 --tunnel-user 选项,或者您没有为用户使用唯一的 key 。
来自SSH configuration section of the SVN Book :
It's also possible to have multiple users share a single account. Instead of creating a separate system account for each user, generate a public/private key pair for each person. Then place each public key into the authorized_keys file, one per line, and use the --tunnel-user option:
command="svnserve -t --tunnel-user=harry" TYPE1 KEY1 [email protected]
command="svnserve -t --tunnel-user=sally" TYPE2 KEY2 [email protected]This example allows both Harry and Sally to connect to the same account via public key authentication. Each of them has a custom command that will be executed; the --tunnel-user option tells svnserve to assume that the named argument is the authenticated user. Without --tunnel-user, it would appear as though all commits were coming from the one shared system account.
强调我的。
根据您对问题的更新,在我看来您正在重复使用 key 。相反,您应该为每个用户生成唯一的 key 。通常,其工作原理是用户生成自己的 key ,然后向您提供您要添加的公钥。如果 key 已存在于 ~/.ssh/authorized_keys 文件中,那么我怀疑最宽松的条目将适用。
关于svn - 多个 SVN 用户使用单个 ssh 帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20176049/