(PPM) Support Tip: Unable to connect to the server at the command line using SSH on windows server
The server is configured for private key authorization. Using SSH, while connecting to the server, the following error is encountered. SSH command is run in verbose mode to print debugging messages.
$ ssh -v XYZhost
OpenSSH_5.6p1, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to XYZhost [xx.xx.x.xx] port 22.
debug1: Connection established.
error: buffer_get_ret: trying to get more bytes 4 than in buffer 0
error: buffer_get_string_ret: cannot extract length
error: key_from_blob: can't read key type
error: key_read: key_from_blob
error: key_read: key_from_blob [** Removed Key **]
When the public/private keys are generated, id_rsa.pub needs to be transferred to the client server to be appended to authorized_keys file.
Sometimes authorized_keys file gets corrupted if the key is copied and pasted rather than properly being file transferred. Some control characters
or new line characters get inserted when the new key is copy/pasted.
In order to see the corrupted entry, do the following.
$ cat -A authorized_keys
If you find control characters, delete the entry from the authorized_keys file and save the changes. Transfer the key(id_rsa.pub) to the remote host using SCP command and append the key to authorized_keys file instead of copying and pasting the key from id_rsa.pub file.
Similarly check if the known_hosts file is corrupted. Run the same command for known_hosts under ~/.ssh directory.
$ cat -A known_hosts
for example, part of the corrupted entry can be found below with some control characters.
localhost ssh-rsa AAAAB3N..............DpXdR=$
The solution is to delete the entry, save the known_hosts file and reconnect to the server so the entry is populated in the file.
**Note**: For detailed instructions on how to configure Private Key authentication with SSH, please refer to "Installation and Administration Guide".