【发布时间】:2021-01-09 04:20:15
【问题描述】:
我正在尝试从 Jenkins 节点远程 ssh 到远程 linux 机器。我在 Jenkins 节点中创建了公钥和私钥,并将公钥复制到远程机器上的 authorized_keys 中。但我无法远程进入远程机器。请检查以下日志。
/home/us-jenkins/jenkins/workspace/engineering/dex/college-dex@tmp/durable-9222db0d/script.sh: line 8: warning: here-document at line 2 delimited by end-of-file (wanted `EOF')
+ ssh -vvv ****@208.53.147.236
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 62: Applying options for *
Pseudo-terminal will not be allocated because stdin is not a terminal.
debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 22 208.53.147.236
debug1: permanently_drop_suid: 1990977432
debug1: identity file /home/us-jenkins/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/us-jenkins/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
ssh_exchange_identification: Connection closed by remote host
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 255
Finished: FAILURE
如果需要任何详细信息,请告诉我。任何帮助将不胜感激。
【问题讨论】:
-
ssh_exchange_identification: Connection closed by remote host这行表示与SSH服务器的连接在打开后立即关闭。 “执行代理命令”行表明您正在尝试通过另一个 ssh 连接代理连接到 208.53.147.236。问题可能是与 208.53.147.236 的连接失败。在尝试通过它代理连接之前,请确保它正常工作。 -
@Kenster 如果我需要检查 Jenkins 节点或远程服务器中的任何文件,请您详细解释一下。
-
@Kenster 我在 ~/.ssh 文件夹中没有找到任何 ssh_config 文件。执行此代理命令的位置。
-
尝试在 ssh_config
#ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h中注释该行 -
@Kenster 我找不到 ssh_config 请在 /usr/bin -rwxr-xr-x 中找到以下详细信息。 1 根 774568 2019 年 6 月 26 日 ssh -rwxr-xr-x。 1 根 360920 2019 年 6 月 26 日 ssh-add-rwxr-xr-x。 1 根 10469 2019 年 6 月 26 日 ssh-copy-id -rwxr-xr-x。 1 根 419208 2019 年 6 月 26 日 ssh-keygen -rwxr-xr-x。 1 根 441024 2019 年 6 月 26 日 ssh-keyscan -rwxr-xr-x。 1 根 23920 2019 年 10 月 9 日 sss_ssh_authorizedkeys -rwxr-xr-x。 1 个根 28000 2019 年 10 月 9 日 sss_ssh_knownhostsproxy
标签: linux jenkins ssh jenkins-pipeline