Bug 3147 - Confusing error message when the public key is missing.
Summary: Confusing error message when the public key is missing.
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: All OpenBSD
: P5 trivial
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_8_3
  Show dependency treegraph
 
Reported: 2020-04-09 19:50 AEST by Jesper Wallin
Modified: 2021-03-04 09:52 AEDT (History)
2 users (show)

See Also:


Attachments
ssh -vvv ifconfig.se (10.17 KB, text/plain)
2020-04-09 21:13 AEST, Jesper Wallin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Wallin 2020-04-09 19:50:31 AEST
I just upgraded my machine to the latest -current as of today. When trying to login to a remote machine using ssh(1), I got the following error because my id_rsa.pub is missing:

> load pubkey "/home/jesper/.ssh/id_rsa": invalid format

The error is very confusing and as I see it, it seems like ssh(1) tries to load my private key and use it as a public key? Or it tries to load the public key *for* my id_rsa, and fails because it does not exist, but then the error should tell me the key/file does not exist rather than invalid format?

Adding the id_rsa.pub again will make the error go away though.
Comment 1 Jakub Jelen 2020-04-09 20:32:35 AEST
Is that really a key you are using for that connection? In what format is it? traditional-PEM/PKCS8 PEM/openssh? Sharing a debug logs would be helpful.
Comment 2 Jesper Wallin 2020-04-09 21:13:01 AEST
Created attachment 3374 [details]
ssh -vvv ifconfig.se
Comment 3 Jesper Wallin 2020-04-09 21:14:53 AEST
(In reply to Jakub Jelen from comment #1)
> Is that really a key you are using for that connection? In what
> format is it? traditional-PEM/PKCS8 PEM/openssh? Sharing a debug
> logs would be helpful.

I've attached the debug output and it's the only key on my system, which works btw, despite the error. It looks like:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,48C1EB3613223186C9C28CE40777D53C

[removed]
-----END RSA PRIVATE KEY-----
Comment 4 Damien Miller 2020-05-08 13:45:24 AEST
This should be fixed by commit 2b13d3934d580370 that will be in the openssh-8.3 release
Comment 5 Damien Miller 2021-03-04 09:52:19 AEDT
close bugs that were resolved in OpenSSH 8.5 release cycle