0

我正在努力让我们的 Ubuntu TeamCity 服务器通过 SSH 签出 repos。基本上我的问题是,我将在哪里指定私钥密码?

在托管 teamcity 的机器上运行 shell 并以运行 teamcity 的用户身份登录时,我可以运行hg clone ssh://hg@localhost/test以克隆存储库“test”。但我必须输入用户的私钥密码。

我的 TeamCity 项目设置为:

  • 从以下位置提取更改: hg clone ssh://hg@localhost/test
  • 密码:(私钥密码)

单击“测试连接”会导致

Test connection failed in Test :: Test 42. '/usr/bin/hg identify ssh://hg@localhost/test' command failed.
stdout: remote: Permission denied, please try again.
remote: Permission denied, please try again.
remote: Permission denied (publickey,password).

stderr: abort: no suitable response from remote hg!
4

1 回答 1

0

如果密钥对仅用于TeamCity服务器与Mercurial存储库的交互,这是最简单且仍然安全的解决方案,前提是您使用限制性足够的访问权限保护私钥文件(即对于TeamCity服务器运行的用户是只读的) ),是从私钥中删除密码。具有空密码短语的私钥将不再​​提示输入密码短语,因此不需要用户交互,从而实现自动化解决方案。

于 2012-10-25T17:48:48.200 回答