在WAS7中执行SSH命令

时间:2017-04-28 14:24:27

标签: java ssh websphere


     我们在Windows Server 2003上使用WAS 7.0.41。从远程计算机获取目录列表时我们遇到了一些问题。 仅当命令作为WAS7.0中的Java程序的一部分执行时,才会出现此问题。当从命令提示符执行相同的命令时,我们得到所需的输出。

  1. 同样,在从命令提示符执行命令时,与WAS中的Java程序相比,从不同的位置获取密钥文件。为什么会有这种差异?
  2. 在WAS中需要采取哪些措施来解决此问题。
  3. 附带命令提示符和WAS SystemOut.log

    的调试日志文件

    从WAS Systemout调试日志:

    command: d:/cygwin/bin/ssh -vvv -o LogLevel=DEBUG3 xxxxx@11.205.1.xx ls -lLtp /u003/app/xxxxx/NJFP1PF/../NJFP1PF/sqr
    Error line :OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
    Error line :debug2: ssh_connect: needpriv 0
    Error line :debug1: Connecting to 11.205.1.xx [11.205.1.xx] port 22.
    Error line :debug1: Connection established.
    Error line :debug1: identity file /.ssh/id_rsa type 1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_rsa-cert type -1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_dsa type -1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_dsa-cert type -1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_ecdsa type -1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_ecdsa-cert type -1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_ed25519 type -1
    Error line :debug1: key_load_public: No such file or directory
    Error line :debug1: identity file /.ssh/id_ed25519-cert type -1
    Error line :debug1: Enabling compatibility mode for protocol 2.0
    Error line :debug1: Local version string SSH-2.0-OpenSSH_6.7
    Error line :debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5
    Error line :debug1: match: OpenSSH_7.5 pat OpenSSH* compat 0x04000000
    Error line :debug2: fd 3 setting O_NONBLOCK
    Error line :debug3: load_hostkeys: loading entries for host "11.205.1.xx" from file "/.ssh/known_hosts"
    Error line :debug3: load_hostkeys: found key type RSA in file /.ssh/known_hosts:3
    Error line :debug3: load_hostkeys: loaded 1 keys
    Error line :debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
    Error line :debug1: SSH2_MSG_KEXINIT sent
    Error line :debug1: SSH2_MSG_KEXINIT received
    Error line :debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
    Error line :debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-dss
    Error line :debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    Error line :debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    Error line :debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    Error line :debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    Error line :debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    Error line :debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    Error line :debug2: kex_parse_kexinit: 
    Error line :debug2: kex_parse_kexinit: 
    Error line :debug2: kex_parse_kexinit: first_kex_follows 0 
    Error line :debug2: kex_parse_kexinit: reserved 0 
    Error line :debug2: kex_parse_kexinit: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
    Error line :debug2: kex_parse_kexinit: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
    Error line :debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
    Error line :debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
    Error line :debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    Error line :debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    Error line :debug2: kex_parse_kexinit: none,zlib@openssh.com
    Error line :debug2: kex_parse_kexinit: none,zlib@openssh.com
    Error line :debug2: kex_parse_kexinit: 
    Error line :debug2: kex_parse_kexinit: 
    Error line :debug2: kex_parse_kexinit: first_kex_follows 0 
    Error line :debug2: kex_parse_kexinit: reserved 0 
    Error line :debug2: mac_setup: setup umac-64-etm@openssh.com
    Error line :debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
    Error line :debug2: mac_setup: setup umac-64-etm@openssh.com
    Error line :debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
    Error line :debug1: sending SSH2_MSG_KEX_ECDH_INIT
    Error line :debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    Error line :debug1: Server host key: RSA ec:05:04:de:76:f3:b9:64:36:b4:6d:3d:23:48:c4:b4
    Error line :debug3: load_hostkeys: loading entries for host "11.205.1.xx" from file "/.ssh/known_hosts"
    Error line :debug3: load_hostkeys: found key type RSA in file /.ssh/known_hosts:3
    Error line :debug3: load_hostkeys: loaded 1 keys
    Error line :debug1: Host '11.205.1.xx' is known and matches the RSA host key.
    Error line :debug1: Found key in /.ssh/known_hosts:3
    Error line :debug2: kex_derive_keys
    Error line :debug2: set_newkeys: mode 1
    Error line :debug1: SSH2_MSG_NEWKEYS sent
    Error line :debug1: expecting SSH2_MSG_NEWKEYS
    Error line :debug2: set_newkeys: mode 0
    Error line :debug1: SSH2_MSG_NEWKEYS received
    Error line :debug1: Roaming not allowed by server
    Error line :debug1: SSH2_MSG_SERVICE_REQUEST sent
    Error line :debug2: service_accept: ssh-userauth
    Error line :debug1: SSH2_MSG_SERVICE_ACCEPT received
    Error line :debug2: key: /.ssh/id_rsa (0x200606e0),
    Error line :debug2: key: /.ssh/id_dsa (0x0),
    Error line :debug2: key: /.ssh/id_ecdsa (0x0),
    Error line :debug2: key: /.ssh/id_ed25519 (0x0),
    Error line :debug3: input_userauth_banner
    Error line :*******************************************************************************
    Error line :*                                                                             *
    Error line :* IBM's internal systems must only be used for conducting IBM's business      *
    Error line :* or for purposes authorized by IBM management.                               *
    Error line :* Use is subject to audit at any time by IBM management                       *
    Error line :*                                                                             *
    Error line :*******************************************************************************
    Error line :
    Error line :*******************************************************************************
    Error line :*    !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!     *
    Error line :*                                                                             *
    Error line :*      Please make sure you have a SR opened or an approved CSR before        *
    Error line :*                 using sudo with any commands on this server                 *
    Error line :*                                                                             *
    Error line :*******************************************************************************
    Error line :debug1: Authentications that can continue: publickey,password,keyboard-interactive
    Error line :debug3: start over, passed a different list publickey,password,keyboard-interactive
    Error line :debug3: preferred publickey,keyboard-interactive,password
    Error line :debug3: authmethod_lookup publickey
    Error line :debug3: remaining preferred: keyboard-interactive,password
    Error line :debug3: authmethod_is_enabled publickey
    Error line :debug1: Next authentication method: publickey
    Error line :debug1: Offering RSA public key: /.ssh/id_rsa
    Error line :debug3: send_pubkey_test
    Error line :debug2: we sent a publickey packet, wait for reply
    Error line :debug1: Server accepts key: pkalg ssh-rsa blen 279
    Error line :debug2: input_userauth_pk_ok: fp 7d:eb:f7:6f:c8:15:4c:cf:f9:58:5e:b4:a5:ac:76:37
    Error line :debug3: sign_and_send_pubkey: RSA 7d:eb:f7:6f:c8:15:4c:cf:f9:58:5e:b4:a5:ac:76:37
    Error line :debug1: Authentication succeeded (publickey).
    Error line :Authenticated to 11.205.1.xx ([11.205.1.xx]:22).
    Error line :debug2: fd 4 setting O_NONBLOCK
    Error line :debug2: fd 5 setting O_NONBLOCK
    Error line :debug2: fd 6 setting O_NONBLOCK
    Error line :debug1: channel 0: new [client-session]
    Error line :debug3: ssh_session2_open: channel_new: 0
    Error line :debug2: channel 0: send open
    Error line :debug1: Requesting no-more-sessions@openssh.com
    Error line :debug1: Entering interactive session.
    Error line :debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
    Error line :debug2: callback start
    Error line :debug2: fd 3 setting TCP_NODELAY
    Error line :debug3: packet_set_tos: set IP_TOS 0x08
    Error line :debug2: client_session2_setup: id 0
    Error line :debug1: Sending command: ls -lLtp /u003/app/xxxxx/NJFP1PF/../NJFP1PF/sqr
    Error line :debug2: channel 0: request exec confirm 1
    Error line :debug2: callback done
    Error line :debug2: channel 0: open confirm rwindow 0 rmax 32768
    Error line :debug2: channel 0: rcvd adjust 2097152
    Error line :debug2: channel_input_status_confirm: type 99 id 0
    Error line :debug2: exec request accepted on channel 0
    

    从命令提示符调试日志:

    C:\cygwin\bin>c:/cygwin/bin/ssh -vvv -o LogLevel=DEBUG3 xxxxx@11.205.1.xx ls -lLtp /u003/app/xxxxx/NJFP1PF/../NJFP1PF/sqr
    OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 11.205.1.xx [11.205.1.xx] port 22.
    debug1: Connection established.
    debug1: identity file /home/isrvceadmin/.ssh/id_rsa type 1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_rsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_dsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_dsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_ecdsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_ecdsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_ed25519 type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/isrvceadmin/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.7
    debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5
    debug1: match: OpenSSH_7.5 pat OpenSSH* compat 0x04000000
    debug2: fd 3 setting O_NONBLOCK
    debug3: load_hostkeys: loading entries for host "11.205.1.xx" from file "/home/isrvceadmin/.ssh/known_hosts"
    debug3: load_hostkeys: found key type RSA in file /home/isrvceadmin/.ssh/known_hosts:3
    debug3: load_hostkeys: loaded 1 keys
    debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sbugha2-nistp384ha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
    debug2: kex_parse_kexinit: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
    debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
    debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
    debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_setup: setup umac-64-etm@openssh.com
    debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
    debug2: mac_setup: setup umac-64-etm@openssh.com
    debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: RSA ec:05:04:de:76:f3:b9:64:36:b4:6d:3d:23:48:c4:b4
    debug3: load_hostkeys: loading entries for host "11.205.1.xx" from file "/home/isrvceadmin/.ssh/known_hosts"
    debug3: load_hostkeys: found key type RSA in file /home/isrvceadmin/.ssh/known_hosts:3
    debug3: load_hostkeys: loaded 1 keys
    debug1: Host '11.205.1.xx' is known and matches the RSA host key.
    debug1: Found key in /home/isrvceadmin/.ssh/known_hosts:3
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: Roaming not allowed by server
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/isrvceadmin/.ssh/id_rsa (0x2005ee20),
    debug2: key: /home/isrvceadmin/.ssh/id_dsa (0x0),
    debug2: key: /home/isrvceadmin/.ssh/id_ecdsa (0x0),
    debug2: key: /home/isrvceadmin/.ssh/id_ed25519 (0x0),
    debug3: input_userauth_banner
    *******************************************************************************
    *                                                                             *
    * IBM's internal systems must only be used for conducting IBM's business      *
    * or for purposes authorized by IBM management.                               *
    * Use is subject to audit at any time by IBM management                       *
    *                                                                             *
    *******************************************************************************
    
    *******************************************************************************
    *    !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!     *
    *                                                                             *
    *      Please make sure you have a SR opened or an approved CSR before        *
    *                 using sudo with any commands on this server                 *
    *                                                                             *
    *******************************************************************************
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug3: start over, passed a different list publickey,password,keyboard-interactive
    debug3: preferred publickey,keyboard-interactive,password
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /home/isrvceadmin/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug1: Server accepts key: pkalg ssh-rsa blen 279
    debug2: input_userauth_pk_ok: fp 7d:eb:f7:6f:c8:15:4c:cf:f9:58:5e:b4:a5:ac:76:37
    debug3: sign_and_send_pubkey: RSA 7d:eb:f7:6f:c8:15:4c:cf:f9:58:5e:b4:a5:ac:76:37
    debug1: Authentication succeeded (publickey).
    Authenticated to 11.205.1.xx ([11.205.1.xx]:22).
    debug2: fd 5 setting O_NONBLOCK
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
    debug2: callback start
    debug2: fd 3 setting TCP_NODELAY
    debug3: packet_set_tos: set IP_TOS 0x08
    debug2: client_session2_setup: id 0
    debug1: Sending command: ls -lLtp /u003/app/xxxxx/NJFP1PF/../NJFP1PF/sqr
    debug2: channel 0: request exec confirm 1
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug2: channel 0: rcvd adjust 2097152
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: exec request accepted on channel 0
    debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
    debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
    debug2: channel 0: rcvd eow
    debug2: channel 0: close_read
    debug2: channel 0: input open -> closed
    debug2: channel 0: rcvd eof
    debug2: channel 0: output open -> drain
    debug2: channel 0: rcvd close
    debug3: channel 0: will not send data after close
    debug3: channel 0: will not send data after close
    debug2: channel 0: obuf empty
    debug2: channel 0: close_write
    debug2: channel 0: output drain -> closed
    debug2: channel 0: almost dead
    debug2: channel 0: gc: notify user
    debug2: channel 0: gc: user detached
    debug2: channel 0: send close
    debug2: channel 0: is dead
    debug2: channel 0: garbage collecting
    debug1: channel 0: free: client-session, nchannels 1
    debug3: channel 0: status: The following connections are open:
      #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)
    
    debug3: fd 1 is not O_NONBLOCK
    Transferred: sent 3348, received 125276 bytes, in 0.3 seconds
    Bytes per second: sent 10713.4, received 400875.4
    debug1: Exit status 0
    

1 个答案:

答案 0 :(得分:0)

知道这不是答案,但你真的应该考虑向上移动。 WAS 7计划于2018年4月结束[1]。 Windows Server 2003扩展支持一直持续到2015年7月14日[2]。

在这两种情况下,您都是成功进行身份验证: debug1:验证成功(publickey)。 认证为11.205.1.xx([11.205.1.xx]:22)。

似乎正在发生的事情是,在WAS中运行的代码与控制台达到了相同的点,但并非一直如此。你是如何在WAS中执行SSH命令的?

要明确的是,WAS没有这样做,所以它是你的应用程序必须做的事情。你正在使用什么库,或者你只是通过像ProcessBuilder这样的shell调用?

[1] https://www-01.ibm.com/software/support/lifecycleapp/PLCDetail.wss?q45=U014343F68568M71 [2] https://en.wikipedia.org/wiki/Windows_Server_2003#Windows_Server_2003_R2