I am setting up a SSH password less connection setup for two server for the first time. I have imported a public key earlier by vi to authorized_keys, but since this was failing so i have asked remote Server team ( Windows using PSCP) to generate one more pri/pub key pair & imported the latest key also by appending the new key in the authorized_keys file.
However I have not removed the earlier key from the authorized_keys and the SSH is still failing with same error. Could you please tell me if this is the reason for this failure.
Below is the set of logs generated from the PSCP logging from remote server trying to connect
Event Log: Writing new session log (SSH packets mode) to file: D:\ssh\ssh.txt
Event Log: Server version: SSH-2.0-OpenSSH_5.3
Event Log: We believe remote version has SSH-2 channel request bug
Event Log: Using SSH protocol version 2
Outgoing packet #0x0, type 20 / 0x14 (SSH2_MSG_KEXINIT)
Incoming packet #0x0, type 20 / 0x14 (SSH2_MSG_KEXINIT)
Event Log: Doing Diffie-Hellman group exchange
Outgoing packet #0x1, type 34 / 0x22 (SSH2_MSG_KEX_DH_GEX_REQUEST)
Incoming packet #0x1, type 31 / 0x1f (SSH2_MSG_KEX_DH_GEX_GROUP)
Event Log: Doing Diffie-Hellman key exchange with hash SHA-256
Outgoing packet #0x2, type 32 / 0x20 (SSH2_MSG_KEX_DH_GEX_INIT)
Incoming packet #0x2, type 33 / 0x21 (SSH2_MSG_KEX_DH_GEX_REPLY)
Event Log: Host key fingerprint is:
Outgoing packet #0x3, type 21 / 0x15 (SSH2_MSG_NEWKEYS)
Event Log: Initialised AES-128 SDCTR client->server encryption
Event Log: Initialised HMAC-SHA-256 client->server MAC algorithm
Incoming packet #0x3, type 21 / 0x15 (SSH2_MSG_NEWKEYS)
Event Log: Initialised AES-128 SDCTR server->client encryption
Event Log: Initialised HMAC-SHA-256 server->client MAC algorithm
Outgoing packet #0x4, type 5 / 0x05 (SSH2_MSG_SERVICE_REQUEST)
Incoming packet #0x4, type 6 / 0x06 (SSH2_MSG_SERVICE_ACCEPT)
Event Log: Reading private key file "key.ppk"
Outgoing packet #0x5, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
Incoming packet #0x5, type 53 / 0x35 (SSH2_MSG_USERAUTH_BANNER)
Incoming packet #0x6, type 51 / 0x33 (SSH2_MSG_USERAUTH_FAILURE)
Outgoing packet #0x6, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
Event Log: Offered public key
Incoming packet #0x7, type 60 / 0x3c (SSH2_MSG_USERAUTH_PK_OK)
Event Log: Offer of public key accepted
Outgoing packet #0x7, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
Event Log: Sent public key signature
Event Log: Server unexpectedly closed network connection
Below the the logs from the windows server trying to connect to Linux generated via -v option of pscp
C:\Users\User>pscp -i "private.ppk" -P 22 -l User -v -sftp
"file.txt" server.domain.com:/outboundpath/
Looking up host "server.domain.com"
Connecting to 199.199.199.127 port 22
We claim version: SSH-2.0-PuTTY_Release_0.67
Server version: SSH-2.0-OpenSSH_5.3
We believe remote version has SSH-2 channel request bug
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-256
Host key fingerprint is:
ssh-rsa 2048
Initialised AES-128 SDCTR client->server encryption
Initialised HMAC-SHA-256 client->server MAC algorithm
Initialised AES-128 SDCTR server->client encryption
Initialised HMAC-SHA-256 server->client MAC algorithm
Reading private key file "private.ppk"
Using username "connect".
LEGAL NOTICE
You may commit a criminal offence if you act outside your
authority in relation to this computer.
Offered public key
Offer of public key accepted
Authenticating with public key "rsa-key-20170424"
Sent public key signature
Server unexpectedly closed network connection
Fatal: Server unexpectedly closed network connection
.ssh
and.authorized_keys
and double-check that the key in the authorized key file doesn't have extraneous spaces or carriage returns.