我们有一个脚本,它在服务器 a 上运行,并通过 ssh 在服务器 b 上执行许多命令。出于某种原因,这在一个系统上停止工作。我不确定 ssh 调试信息被转储到我的日志中的原因。除了脚本的最后一部分之外,它似乎一切都很好。这是 ssh 调试信息。
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config^M
debug1: Applying options for *^M
debug1: Connecting to b-classicbeauty.cloudapp.net [137.117.44.178] port 22.^M
debug1: Connection established.^M
debug1: permanently_set_uid: 0/0^M
debug1: identity file /root/.ssh/identity type -1^M
debug1: identity file /root/.ssh/identity-cert type -1^M
debug1: identity file /root/.ssh/id_rsa type 1^M
debug1: identity file /root/.ssh/id_rsa-cert type -1^M
debug1: identity file /root/.ssh/id_dsa type 2^M
debug1: identity file /root/.ssh/id_dsa-cert type -1^M
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3^M
debug1: match: OpenSSH_5.3 pat OpenSSH*^M
debug1: Enabling compatibility mode for protocol 2.0^M
debug1: Local version string SSH-2.0-OpenSSH_5.3^M
debug1: SSH2_MSG_KEXINIT sent^M
debug1: SSH2_MSG_KEXINIT received^M
debug1: kex: server->client aes128-ctr hmac-md5 none^M
debug1: kex: client->server aes128-ctr hmac-md5 none^M
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent^M
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP^M
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent^M
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY^M
debug1: Host 'server b' is known and matches the RSA host key.^M
debug1: Found key in /root/.ssh/known_hosts:2^M
debug1: ssh_rsa_verify: signature correct^M
debug1: SSH2_MSG_NEWKEYS sent^M
debug1: expecting SSH2_MSG_NEWKEYS^M
debug1: SSH2_MSG_NEWKEYS received^M
debug1: SSH2_MSG_SERVICE_REQUEST sent^M
debug1: SSH2_MSG_SERVICE_ACCEPT received^M
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password^M
debug1: Next authentication method: gssapi-keyex^M
debug1: No valid Key exchange context^M
debug1: Next authentication method: gssapi-with-mic^M
Credentials cache file '/tmp/krb5cc_0' not found
^M
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found
^M
debug1: Unspecified GSS failure. Minor code may provide more information
^M
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found
^M
debug1: Next authentication method: publickey^M
debug1: Trying private key: /root/.ssh/identity^M
debug1: Offering public key: /root/.ssh/id_rsa^M
debug1: Server accepts key: pkalg ssh-rsa blen 277^M
debug1: read PEM private key done: type RSA^M
debug1: Authentication succeeded (publickey).^M
debug1: channel 0: new [client-session]^M
debug1: Requesting [email protected]^M
debug1: Entering interactive session.^M
debug1: Sending environment.^M
debug1: Sending env LANG = en_US.UTF-8^M
debug1: Sending command: cd /tmp/cloudbackup/95094; 7za a 95094081015.7z cloudbackup -phuntforhonor^M
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0^M
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0^M
debug1: channel 0: free: client-session, nchannels 1^M
debug1: fd 0 clearing O_NONBLOCK^M
debug1: fd 1 clearing O_NONBLOCK^M
debug1: fd 2 clearing O_NONBLOCK^M
Transferred: sent 2584, received 2552 bytes, in 0.2 seconds^M
Bytes per second: sent 13219.8, received 13056.1^M
debug1: Exit status 2^M
因此,它通过 ssh 将所有数据发送到服务器。然后它成功压缩所述数据,但下一个命令是将压缩数据放入云存储中,而这似乎就是它失败的地方。我已经确认不是我们的 jar 文件来完成这一任务,才导致了这个输出。