svn - 多个 SVN 用户使用单个 ssh 帐户

标签 svn ssh ssh-tunnel

我正在尝试使用多个 svn 作者作为单个托管 ssh 帐户。我遵循 http://svn.apache.org/repos/asf/subversion/trunk/notes/ssh-tricks 中的技巧对于隧道用户,但它仍然显示与我的托管 ssh 帐户用户名相同的作者。我还检查了 SVN 版本必须更新到 1.0.x 才能使其适用于隧道用户。

更新

我遵循的内容:

  1. 首先,我从我的托管帐户 id_rsa 获取了 key
  2. 然后我用了PuttyGen导入并提取私钥。
  3. 之后我创建了一个 session在 Putty 中,我完成了 域名(.com/.net 等)并在 SSH->AUTH 中附加私钥 我在data中添加了我的托管帐户用户名用于自动登录。
  4. 为了进行验证,我检查了 session ,并且无需询问即可正常工作 任何密码。
  5. 现在我创建了我的 id_rsa 的副本输入~/.ssh目录为 authorized_keys这是 svnserve 所要求的
  6. 然后我添加了一行 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>
  7. 现在,一切准备就绪后,我在服务器上创建了一个存储库 svnadmin create myrepo
  8. 我通过 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/

相关文章:

mysql - 使用 SSH 隧道从 Node-Red 连接到远程 MYSQL 数据库

node.js - chromeos 上的 ssh 隧道连接被拒绝

database - SVN E155016 ... 的工作副本数据库已损坏

eclipse - 无法使用 Eclipse 3.4.0、svn 1.5.1 创建 subversion 存储库

eclipse - 如何为 SVN 文件和 Eclipse 设置字符集编码属性

python - 在 Python 中使用代理命令连接到 SFTP 客户端

c# - 不影响 TortoiseSVN 凭据的 SharpSVN 身份验证

postgresql 服务器不听

java - 通过 Java JSch 库在远程机器上执行本地脚本

python - 使用 Paramiko 在远程机器上执行命令无效