windows TeamCity GitHub 私钥访问被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2376678/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:04:08  来源:igfitidea点击:

TeamCity GitHub Private Key Access Denied

windowsteamcitygithub

提问by Chance Robertson

Does anyone know of a tutorial for using TeamCity with github with ssh private keys. I have tried to set up git hub to connect and I either get a authentication error or get access denied. I am running TeamCity on Windows 2003. I am running the build agent as a custom account. I am running the web server under the administrator account. I have create a key for the custom account and administrator account. I now get an error that:

有谁知道使用带有 ssh 私钥的 github 和 TeamCity 的教程。我试图设置 git hub 以进行连接,但出现身份验证错误或访问被拒绝。我在 Windows 2003 上运行 TeamCity。我将构建代理作为自定义帐户运行。我在管理员帐户下运行 Web 服务器。我为自定义帐户和管理员帐户创建了一个密钥。我现在收到一个错误:

The connection test failed: com.jcraft.jsch.JSchException: java.io.FileNotFoundException: C:\Documents and Settings\Administrator.ssh (Access is denied)

连接测试失败:com.jcraft.jsch.JSchException: java.io.FileNotFoundException: C:\Documents and Settings\Administrator.ssh (Access is denied)

If anyone has successfully set this up please help. I am going on 3 hours into this and want to get it solved.

如果有人成功设置了这个,请帮忙。我正在进行 3 个小时的工作,并希望解决它。

Thanks.

谢谢。

回答by Markus Dulghier

The following VCS Root configuration works for me:

以下 VCS Root 配置适用于我:

  • Clone URL: [email protected]:username/repository.git
  • Clone repository to: C:\somepath
  • User Name Style: UserId (jsmith)
  • Authentication Method: Private Key
  • Private Key Path: C:\SSH\myKeyFile.priv
  • Passphrase: only if key file is secured with a passphrase
  • 克隆地址:[email protected]:username/repository.git
  • 将存储库克隆到:C:\somepath
  • 用户名样式:UserId (jsmith)
  • 认证方式:私钥
  • 私钥路径:C:\SSH\myKeyFile.priv
  • 密码:仅当使用密码保护密钥文件时

回答by Alex Nguyen

if you haven't figured this out yet...

如果你还没有弄清楚这一点......

this config worked out for me

这个配置对我有用

Authentication Method: Default Private Key

认证方式:默认私钥

UserName: (blank)

用户名:(空白)

Known Hosts Database <<-- CHECK IT!

已知主机数据库 <<--检查一下!

thats what finally worked after a couple of hours trying to get it to work :)

这就是在尝试让它工作几个小时后终于奏效的方法:)