Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
Absent Member.. rchundi Absent Member..
Absent Member..
176 views

(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.

Error:
$ 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 **]
failed

 

Solution:
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=$
^M$

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".

Labels (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.