On 2006-03-29, Vit wrote:
> I have two linux boxes with passwordless SSH key setup. It worked for
> me for some time but suddenly I've started getting "PEM_read_PrivateKey
> failed" message:
> 18223: debug1: try privkey: /root/.ssh/identity
> 18223: debug1: PEM_read_PrivateKey failed
>
> I've copied /root/.ssh/identity to anothe box and passwordless ssh
> worked flawlessly. I've also regenerated passwordless keys on my
> original box but it did not help. So I'm quite sure that the problem is
> not releated to the key itself.


"identity" is (usually) a SSHv1 key, however...

> 18223: Enabling compatibility mode for protocol 2.0


You're making an sshv2 connection.

> 18223: debug1: try privkey: /root/.ssh/identity
> 18223: debug1: PEM_read_PrivateKey failed
> 18223: debug1: read PEM private key done: type
> Enter passphrase for key '/root/.ssh/identity':


I'm not sure why ssh is prompting for a passphrase here.

Check the file formats of your keys. They should be similar to:

$ head -1 identity
SSH PRIVATE KEY FILE FORMAT 1.1

$ head -2 id_rsa
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED

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