繁体   English   中英

Jenkins SSH到Amazon EC2实例

[英]Jenkins ssh to amazon ec2 instance

我是jenkins的新手,并希望ssh到Amazon ec2实例并在其中执行一些步骤。 现在,我只是尝试ssh到我的Amazon实例。 我正在使用“ Execute shell”在EC2上执行命令。 不,我刚刚输入了ssh ec2-user @命令。 我不知道在哪里,所以我指定了ssh键来连接到实例。 现在,如果我运行构建,则会收到以下错误:

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/LAD/workspace
[workspace] $ /bin/sh -xe /tmp/hudson4524738745485196769.sh
+ ssh -v ec2-user@<my ip address>
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
Pseudo-terminal will not be allocated because stdin is not a terminal.
debug1: Connecting to <my ip address> [<my ip address>] port 22.
debug1: Connection established.
debug1: identity file /var/lib/jenkins/.ssh/id_rsa type -1
debug1: identity file /var/lib/jenkins/.ssh/id_rsa-cert type -1
debug1: identity file /var/lib/jenkins/.ssh/id_dsa type -1
debug1: identity file /var/lib/jenkins/.ssh/id_dsa-cert type -1
debug1: identity file /var/lib/jenkins/.ssh/id_ecdsa type -1
debug1: identity file /var/lib/jenkins/.ssh/id_ecdsa-cert type -1
debug1: identity file /var/lib/jenkins/.ssh/id_ed25519 type -1
debug1: identity file /var/lib/jenkins/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: curve25519-sha256@libssh.org need=16 dh_need=16
debug1: kex: curve25519-sha256@libssh.org need=16 dh_need=16
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 74:0d:73:17:f2:78:c4:51:e4:c4:55:8f:6d:94:9f:7a
debug1: read_passphrase: can't open /dev/tty: No such device or address
Host key verification failed.
Build step 'Execute shell' marked build as failure
Finished: FAILURE

如何在构建的jenkins“执行外壳”部分中将ssh放入ec2实例? 请帮忙。

您需要通过SSH进入jenkins主文件系统并将其放置在Jenkins盒子上,将SSH密钥本地放置在您的Jenkins盒子上。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM