Eu tenho uma aplicação java, onde estou tentando SSH para o ambiente de tempo de execução OSGI. O aplicativo está sendo executado dentro da janela de encaixe.
Eu verifiquei que a porta atribuída para ouvir solicitações SSH está aberta. Eu corri este comando - netstat -anp | grep -w LISTEN
para verificar o mesmo.
Aqui está a saída:
tcp 0 0 172.17.0.3:8080 0.0.0.0:* LISTEN 1/java
tcp 0 0 0.0.0.0:8090 0.0.0.0:* LISTEN 1/java
tcp 0 0 0.0.0.0:7777 0.0.0.0:* LISTEN 1/java
tcp 0 0 0.0.0.0:1122 0.0.0.0:* LISTEN 1/java
Quando executo este comando - ssh -v -p 1122 equinox@localhost
, especificamente com a atualização do JRE 161 e 162, recebo o seguinte erro.
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 1122.
debug1: Connection established.
debug1: identity file /home/vcap/.ssh/id_rsa type -1
debug1: identity file /home/vcap/.ssh/id_rsa-cert type -1
debug1: identity file /home/vcap/.ssh/id_dsa type -1
debug1: identity file /home/vcap/.ssh/id_dsa-cert type -1
debug1: identity file /home/vcap/.ssh/id_ecdsa type -1
debug1: identity file /home/vcap/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/vcap/.ssh/id_ed25519 type -1
debug1: identity file /home/vcap/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.10
debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.7.0
debug1: no match: SSHD-CORE-0.7.0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
Connection closed by 127.0.0.1
Por outro lado, se eu executar o mesmo aplicativo com a atualização do JRE 151/152, posso executar com êxito o SSH no ambiente de tempo de execução. Incluindo a saída detalhada do SSH bem-sucedida:
root@804dcbda8ffd:/# ssh -v -p 1122 equinox@localhost
OpenSSH_6.7p1 Debian-5+deb8u4, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 1122.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: SELinux support disabled
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u4
debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.7.0
debug1: no match: SSHD-CORE-0.7.0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-sha1 none
debug1: kex: client->server aes128-cbc hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: DSA ff:ef:e3:41:4c:67:9b:88:ec:93:d6:81:36:29:9e:66
debug1: checking without port identifier
The authenticity of host '[localhost]:1122 ([127.0.0.1]:1122)' can't be established.
DSA key fingerprint is ff:ef:e3:41:4c:67:9b:88:ec:93:d6:81:36:29:9e:66.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:1122' (DSA) to the list of known hosts.
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password
debug1: Next authentication method: password
equinox@localhost's password:
debug1: Authentication succeeded (password).
Authenticated to localhost ([127.0.0.1]:1122).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
Currently the default user is the only one; since it will be deleted after first login, create a new user:
username: 06:26:02.346 DEBUG [Thread-63] o.a.s.server.channel.ChannelSession - Send SSH_MSG_CHANNEL_DATA on channel 0
Currently the default user is the only one; since it will be deleted after first login, create a new user:
username: admin
password: 06:26:04.946 DEBUG [Thread-63] o.a.s.server.channel.ChannelSession - Send SSH_MSG_CHANNEL_DATA on channel 0
password:
Password should be at least 8 characters
password: 06:26:07.627 DEBUG [Thread-63] o.a.s.server.channel.ChannelSession - Send SSH_MSG_CHANNEL_DATA on channel 0
Password should be at least 8 characters
pass
Confirm password: 06:26:16.721 DEBUG [Thread-63] o.a.s.server.channel.ChannelSession - Send SSH_MSG_CHANNEL_DATA on channel 0
Confirm password:
roles: 06:26:19.506 DEBUG [Thread-63] o.a.s.server.channel.ChannelSession - Send SSH_MSG_CHANNEL_DATA on channel 0
roles: 1
admin@standalone> 06:26:20.666 DEBUG [Thread-63] o.a.s.server.channel.ChannelSession - Send SSH_MSG_CHANNEL_DATA on channel 0
Seria ótimo se alguém pudesse me ajudar a descobrir o que poderia estar causando esse problema. Obrigado.