Team City Git“主机密钥验证失败";

编程入门 行业动态 更新时间:2024-10-26 07:23:37
本文介绍了Team City Git“主机密钥验证失败";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用TeamCity从远程Git存储库提取代码,更新文件(并暂存并提交到本地存储库),然后将提交的文件推回远程存储库.

I want to use TeamCity to pull code from a remote Git repo, update a file (and stage and commit to the local repo) and then push the committed file back to the remote repo.

拉力&更新很好.如果我打开git-bash和git push origin master,则提交(从更新的文件提交到本地仓库开始)将被推送到远程仓库.好吧.

The pull & update is fine. If I open git-bash and git push origin master then the commit (arising from the updated file being committed to the local repo) is pushed to the remote repo. Fine.

如果我尝试使用Team City的命令行运行程序执行此操作(到同一远程目标存储库),则失败

If I try to do this (to the same remote target repo) using a Team City's Command Line runner it fails with

[14:49:18][Step 3/7] Host key verification failed. [14:49:18][Step 3/7] fatal: Could not read from remote repository.

目标存储库正在使用Gerrit进行身份验证.我已将公共密钥上载到Gerrit,并且已确认Gerrit的服务器主机密钥在C:\Users\AccountName\.ssh\known_hosts中.该文件夹还包含公钥和私钥.

The target repo is using Gerrit for authentication. I have uploaded the public key to Gerrit and I have confirmed that the Server Host Key from Gerrit is in C:\Users\AccountName\.ssh\known_hosts. That folder also contains the public and private key.

我可以使用git-bash进行推送的事实告诉我密钥在正确的位置,但令我感到困惑的是,为什么Team City Command Line运行者不使用它们.

The fact that I can push using git-bash says to me that the keys are in the correct places, but I am puzzled as to why the Team City Command Line runner is not using them.

作为参考,构建步骤的命令参数为-c "git push origin master".

For ref the build step's Command Parameters are -c "git push origin master".

任何人都可以看到我所缺少的吗?

Can anyone see what I am missing?

谢谢

推荐答案

您必须将TeamCity服务设置为可以访问您的密钥的同一帐户运行.默认情况下,TeamCity使用系统"帐户,这就是为什么不使用您的密钥的原因.

You have to set TeamCity service to run as the same account that has access to your keys. By default TeamCity uses the "System" account so that's why your keys are not being used.

更多推荐

Team City Git“主机密钥验证失败";

本文发布于:2023-11-17 05:31:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609002.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密钥   主机   City   Team   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!