背景信息詹金斯建设 - 试图执行shell命令,其中包括SSH命令
我试图让詹金斯作为我的生成过程中的一部分执行以下shell命令:
ssh [email protected]
rc-status
现在它的失败,出现以下错误信息:
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/Ansible Repo/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://git.core.myinternaldomain.net/cgit/ansible.git/ # timeout=10
Fetching upstream changes from http://git.core.myinternaldomain.net/cgit/ansible.git/
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.username git # timeout=10
> git config --local credential.helper store --file=/tmp/git805322146950822569.credentials # timeout=10
> git -c core.askpass=true fetch --tags --progress http://git.myinternaldomain.net/cgit/ansible.git/ +refs/heads/*:refs/remotes/origin/*
> git config --local --remove-section credential # timeout=10
> git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/dev^{commit} # timeout=10
Checking out Revision 3cf34f240632e3296793c130f4589fbceb37f5bf (refs/remotes/origin/dev)
> git config core.sparsecheckout # timeout=10
> git checkout -f 3cf34f240632e3296793c130f4589fbceb37f5bf
> git rev-list 3cf34f240632e3296793c130f4589fbceb37f5bf # timeout=10
[workspace] $ /bin/sh -xe /tmp/hudson50385520935510733.sh
+ ssh [email protected]
Pseudo-terminal will not be allocated because stdin is not a terminal.
Host key verification failed.
Build step 'Execute shell' marked build as failure
Finished: FAILURE
我试过到目前为止:
不幸的是,它似乎没有告诉我known_hosts文件中它不喜欢的行号。 在运行jenkins的同一台服务器上,我可以成功从远程服务器10.111.11.11 ssh中,在命令提示符下没有错误。
难道这是事实,它试图作为“匿名”,而不是我的ID? 如果是这样,我该如何解决这个问题?我看不到任何可以让我指定用户作为jenkins中的ssh的东西。
感谢。
你好。我怎么知道用户詹金斯运行的是什么?对不起,这对詹金斯来说实际上就是我的第一天,我也对系统管理员的东西感到厌烦。我是一个低级程序员,试图介绍ci – Happydevdays
有很多方法。例如。您可以在shell步骤中运行命令'whoami'。 – jil
我认为ssh-agent正是我现在需要的。我会看看。谢谢。 – Happydevdays