Encontrei alguns casos (por exemplo, API OSGi, porta 2222), em que a conexão SSH via PuTTY não autentica no login, enquanto a mesma autenticação / senha de autenticação exata é obtida via mRemoteNG.
O sintoma de falha do PuTTY é exibir uma caixa de mensagem
PuTTY Fatal Error
com a seguinte mensagem:
"Server unexpectedly closed network connection"
sem entrada de log correspondente em /var/log/secure
do servidor.
Ambos são bem-sucedidos na porta 22 no mesmo servidor. Ambos usam o SSH 2.0.
Ativando All session output
no log do PuTTY, registra apenas isto:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.12.26 13:11:05 =~=~=~=~=~=~=~=~=~=~=~=
login as: root
Further authentication required
SSH server: Password authentication
Using keyboard-interactive authentication.
Password:
Quando habilitei SSH packets and raw data
, putty.log incluiu muito mais informações. Para manter esta postagem breve, omiti os dados brutos:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.12.26 13:15:10 =~=~=~=~=~=~=~=~=~=~=~=
Event Log: Writing new session log (SSH raw data mode) to file: putty.log
Event Log: Connecting to 192.168.1.2 port 2222
Event Log: We claim version: SSH-2.0-PuTTY_Release_0.69
Incoming raw data at 2017-12-26 13:15:10
00000000 53 53 48 2d 32 2e 30 2d 53 53 48 44 2d 43 4f 52 SSH-2.0-SSHD-COR
00000010 45 2d 30 2e 39 2e 30 0d 0a E-0.9.0..
Event Log: Server version: SSH-2.0-SSHD-CORE-0.9.0
Event Log: Using SSH protocol version 2
Outgoing packet #0x0, type 20 / 0x14 (SSH2_MSG_KEXINIT)
...
Outgoing raw data at 2017-12-26 13:15:10
...
Incoming raw data at 2017-12-26 13:15:10
...
Incoming packet #0x0, type 20 / 0x14 (SSH2_MSG_KEXINIT)
...
Event Log: Using Diffie-Hellman with standard group "group14"
Event Log: Doing Diffie-Hellman key exchange with hash SHA-1
Outgoing packet #0x1, type 30 / 0x1e (SSH2_MSG_KEXDH_INIT)
...
Outgoing raw data at 2017-12-26 13:15:10
...
Incoming raw data at 2017-12-26 13:15:10
...
Incoming packet #0x1, type 31 / 0x1f (SSH2_MSG_KEXDH_REPLY)
...
Event Log: Host key fingerprint is:
Event Log: ssh-dss 1024 e6:85:76:7f:cb:6e:b6:21:b7:47:d0:86:a6:3f:3c:b6
Outgoing packet #0x2, type 21 / 0x15 (SSH2_MSG_NEWKEYS)
Outgoing raw data at 2017-12-26 13:15:10
...
Event Log: Initialised AES-256 SDCTR client->server encryption
Event Log: Initialised HMAC-SHA1 client->server MAC algorithm
Outgoing raw data at 2017-12-26 13:15:10
Incoming raw data at 2017-12-26 13:15:10
...
Incoming packet #0x2, type 21 / 0x15 (SSH2_MSG_NEWKEYS)
Event Log: Initialised AES-256 SDCTR server->client encryption
Event Log: Initialised HMAC-SHA1 server->client MAC algorithm
Outgoing packet #0x3, type 5 / 0x05 (SSH2_MSG_SERVICE_REQUEST)
...
Outgoing raw data at 2017-12-26 13:15:10
...
Incoming raw data at 2017-12-26 13:15:10
...
Incoming packet #0x3, type 6 / 0x06 (SSH2_MSG_SERVICE_ACCEPT)
...
Outgoing packet #0x4, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
...
Outgoing raw data at 2017-12-26 13:15:12
...
Incoming raw data at 2017-12-26 13:15:12
...
Incoming packet #0x4, type 51 / 0x33 (SSH2_MSG_USERAUTH_FAILURE)
...
Event Log: Further authentication required
Outgoing packet #0x5, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
...
Outgoing raw data at 2017-12-26 13:15:12
...
Event Log: Attempting keyboard-interactive authentication
Incoming raw data at 2017-12-26 13:15:13
...
Incoming packet #0x5, type 60 / 0x3c (SSH2_MSG_USERAUTH_INFO_REQUEST)
...
Outgoing packet #0x6, type 61 / 0x3d (SSH2_MSG_USERAUTH_INFO_RESPONSE)
...
Outgoing packet #0x7, type 2 / 0x02 (SSH2_MSG_IGNORE)
...
Outgoing raw data at 2017-12-26 13:15:15
...
Incoming raw data at 2017-12-26 13:15:15
...
Incoming packet #0x6, type 52 / 0x34 (SSH2_MSG_USERAUTH_SUCCESS)
Event Log: Access granted
Event Log: Opening session as main channel
Outgoing packet #0x8, type 90 / 0x5a (SSH2_MSG_CHANNEL_OPEN)
...
Outgoing raw data at 2017-12-26 13:15:15
...
Incoming raw data at 2017-12-26 13:15:15
...
Incoming packet #0x7, type 91 / 0x5b (SSH2_MSG_CHANNEL_OPEN_CONFIRMATION)
...
Event Log: Opened main channel
Outgoing packet #0x9, type 98 / 0x62 (SSH2_MSG_CHANNEL_REQUEST)
...
Outgoing raw data at 2017-12-26 13:15:15
...
Outgoing packet #0xa, type 98 / 0x62 (SSH2_MSG_CHANNEL_REQUEST)
...
Outgoing raw data at 2017-12-26 13:15:15
...
Event Log: Server unexpectedly closed network connection
Alguma ideia do que poderia ser o motivo dessa diferença entre dois clientes SSH aparentemente compatíveis?
ATUALIZAÇÃO:
Depois de descobrir que o mRemoteNG usa uma versão modificada do PuTTY chamada mPuTTYNG (que parece e se parece exatamente com o PuTTY, mas ao contrário do PuTTY ele consegue se conectar ao host remoto), eu ativei o log também e comparei a diferença: / p>
Parecequeosdoisusamumconjuntodecifrassignificativamente<...>Poderiaissoseromotivo?
OTOH,ambosusamDiffie-Hellmancomomesmogrupoehashexato:
EventLog:UsingDiffie-Hellmanwithstandardgroup"group14"
Event Log: Doing Diffie-Hellman key exchange with hash SHA-1