Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PEM_read_PrivateKey failed - many posts, but few answers.

1,383 views
Skip to first unread message

sleepy

unread,
Nov 27, 2007, 10:51:51 AM11/27/07
to rhof...@blinn.edu
I'm working on setting up key authentication to transfer a file from
my client to a server. I'm running OpenSSH_4.1 on HPUX and the
server is running GlobalSCAPE Secure FTP Server (v. 3.1) on windows
I'm guessing.

The server admin sent me there key and I used a cat cmd to add it to
the Authorized_keys file in the ~/.ssh dir.

I keep receiving the following error. I'm guessing that there is a
problem with the key, I will include some of it also.

I'm out of options. If someone can look at this and tell me that the
problem is, I will definitely owe them a cold one.

Thanks
Richard


*-------------------------------------------------------------------*
$ sftp -vvv -F /home/bncb0316/.ssh/ssh_config sftp.server.com
Connecting to sftp.server.com...
OpenSSH_4.1, OpenSSL 0.9.7e 25 Oct 2004
HP-UX Secure Shell-A.04.00.000, HP-UX Secure Shell version
debug1: Reading configuration data /home/bncb0316/.ssh/ssh_config
debug3: RNG is ready, skipping seeding
debug2: ssh_connect: needpriv 0
debug1: Connecting to sftp.server.com [ip address was here] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/bncb0316/.ssh/bncb0316.ppk.
debug2: key_type_from_name: unknown key type 'PuTTY-User-Key-File-2:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Encryption:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Comment:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Public-Lines:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type 'Private-Lines:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type 'Private-MAC:'
debug3: key_read: missing keytype
debug1: identity file /home/bncb0316/.ssh/bncb0316.ppk type -1
debug1: Remote protocol version 2.0, remote software version 1.36
sshlib: GlobalScape
debug1: no match: 1.36 sshlib: GlobalScape
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.1
debug2: fd 4 setting O_NONBLOCK
debug3: RNG is ready, skipping seeding
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-
hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-
cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysat
or.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-
cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysat
or.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-
ripe...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-
ripe...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-dss
debug2: kex_parse_kexinit: twofish-cbc,twofish128-cbc,blowfish-cbc,
3des-cbc,arcfour,cast128-cbc
debug2: kex_parse_kexinit: twofish-cbc,twofish128-cbc,blowfish-cbc,
3des-cbc,arcfour,cast128-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: zlib,none
debug2: kex_parse_kexinit: zlib,none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client 3des-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server 3des-cbc hmac-md5 none
debug2: dh_gen_key: priv key bits set: 177/384
debug2: bits set: 509/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug3: check_host_in_hostfile: filename /home/bncb0316/.ssh/
known_hosts
debug3: check_host_in_hostfile: match line 2
debug3: check_host_in_hostfile: filename /home/bncb0316/.ssh/
known_hosts
debug3: check_host_in_hostfile: match line 3
debug1: Host 'sftp.server.com' is known and matches the DSA host key.
debug1: Found key in /home/bncb0316/.ssh/known_hosts:2
debug2: bits set: 545/1024
debug1: ssh_dss_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/bncb0316/.ssh/bncb0316.ppk (00000000)
debug3: input_userauth_banner
GlobalSCAPE Secure FTP Server (v. 3.1)debug1: Authentications that can
continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/bncb0316/.ssh/bncb0316.ppk
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/bncb0316/.ssh/bncb0316.ppk':
debug2: no passphrase given, try next key
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
*-------------------------------------------------------------------*


Key follows.
*-------------------------------------------------------------------*
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20070220
Public-Lines: 4
AAAAB3NzaC1yc2EAAAABJQAAAIEAg5nnm6NkK6zCDWkNq0rtuSo53s+UAnj8g6e9
<snip>
UF363bc=
Private-Lines: 8
AAAAgBx0TcDJYcRBB1zYcah+50qhWJ7gxg5fWTE5BlUbxsDpjYMVSImdHr9F75pk
DIpWOsGwkJpZR7OKNfgNv6/tNggeWHnBGLUBQjf4Ypoyid3O8Tc/J/XnTvs9mePd
zmjdiDRZWvQz8AaT9J2LX5RYVhvt6RCSSkTcxp/ukzx2pUttAAAAQQDfZifTCgMA
7cwzwXDQWdCc1qggL6IZw1O8fgP2CS8mWp7eCqvWgVoyfyjU5kK6xwhSKFGakdCN
<snip>
*-------------------------------------------------------------------*

/home/bncb0316/.ssh/ssh_config
*-------------------------------------------------------------------*

RSAAuthentication yes
DSAAuthentication yes
PubkeyAuthentication yes
IdentityFile ~/.ssh/bncb0316.ppk
Port 22
Protocol 2
HashKnownHosts yes

Darren Tucker

unread,
Nov 28, 2007, 12:14:09 PM11/28/07
to
On 2007-11-27, sleepy <rhof...@blinn.edu> wrote:
> I'm working on setting up key authentication to transfer a file from
> my client to a server. I'm running OpenSSH_4.1 on HPUX and the
> server is running GlobalSCAPE Secure FTP Server (v. 3.1) on windows
> I'm guessing.
[...]

> debug1: Trying private key: /home/bncb0316/.ssh/bncb0316.ppk
> debug1: PEM_read_PrivateKey failed
> debug1: read PEM private key done: type <unknown>

.ppk files are usually PuTTY key files.

> *-------------------------------------------------------------------*
> PuTTY-User-Key-File-2: ssh-rsa

Sure looks like it. OpenSSH doesn't understand PuTTY's key file format
so you will need to convert it (see ssh-keygen, but you will need to
convert the key to IETF format first) or better yet, just generate
a new key on the HP box (since you posted parts of the key) and put
the public key portion of the new key onto your server.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

sleepy

unread,
Nov 28, 2007, 4:41:57 PM11/28/07
to
>
> Sure looks like it. OpenSSH doesn't understand PuTTY's key file format
> so you will need to convert it (see ssh-keygen, but you will need to
> convert the key to IETF format first) or better yet, just generate
> a new key on the HP box (since you posted parts of the key) and put
> the public key portion of the new key onto your server.
>


I know that I can convert IETF to OpenSSH with the following.

ssh-keygen -i -f ietf-pubkey.pub >openssh-pubkey.pub

Anyone know how I can get the Putty Key into the IETF format?

Else Im just going to create a pair of keys here on our system and try
sending the vendor the pub key.

Thanks again.
Richard

Simon Tatham

unread,
Nov 28, 2007, 5:26:34 PM11/28/07
to
sleepy <rhof...@blinn.edu> wrote:
> I know that I can convert IETF to OpenSSH with the following.
>
> ssh-keygen -i -f ietf-pubkey.pub >openssh-pubkey.pub
>
> Anyone know how I can get the Putty Key into the IETF format?

PuTTYgen can convert a PuTTY-format private key into an IETF-format
public key, or even directly into OpenSSH format if you prefer.
Either of the Windows GUI PuTTYgen, or the Unix command-line one,
can do the job fine.
--
Simon Tatham "A defensive weapon is one with my finger on the
<ana...@pobox.com> trigger. An offensive weapon is one with yours."

sleepy

unread,
Nov 28, 2007, 5:54:14 PM11/28/07
to
>
> > Anyone know how I can get the Putty Key into the IETF format?
>
> PuTTYgen can convert a PuTTY-format private key into an IETF-format
> public key, or even directly into OpenSSH format if you prefer.
> Either of the Windows GUI PuTTYgen, or the Unix command-line one,
> can do the job fine.
> --
> Simon Tatham "A defensive weapon is one with my finger on the
> <ana...@pobox.com> trigger. An offensive weapon is one with yours."


I will mention this to the vendor if he is not willing to use my key.

Thanks
Richard

0 new messages