Bug 2342 - ssh-keygen gives wrong error loading public key message
Summary: ssh-keygen gives wrong error loading public key message
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-keygen (show other bugs)
Version: 6.7p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-23 23:43 AEDT by Ismail Donmez
Modified: 2021-04-23 15:09 AEST (History)
1 user (show)

See Also:


Attachments
Problematic file (90 bytes, text/plain)
2015-02-23 21:07 AEDT, Ismail Donmez
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ismail Donmez 2015-01-23 23:43:17 AEDT
Using latest openssh-portable.git

[~]> cat foo 
i10z.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIkPOwWQHARlE7C+wFr2dl/zUu97AUG/YpfwgpDgYH2z

[~]> /usr/local/bin/ssh-keygen -l -f ./foo
Error loading public key "./foo": No such file or directory
256 SHA256:9BPlb4ZU9f4OP3LEz9cqYhJYR5EtefTd3PInri50Zc4 i10z.com (ED25519)

Using ssh-keygen from openssh 6.6.1p1 :

[~]> /usr/bin/ssh-keygen -l -f ./foo 
256 10:3a:04:2d:ea:63:64:31:6c:de:ec:4c:ae:fb:ef:dc [MD5] i10z.com (ED25519)
Comment 1 Damien Miller 2015-02-21 09:19:05 AEDT
I can't replicate this:

[djm@fuyu openssh]$ mkdir x
[djm@fuyu openssh]$ cd x
[djm@fuyu x]$ ../ssh-keygen -t ed25519 -f key -N '' -q
[djm@fuyu x]$ ../ssh-keygen -lf ^C
[djm@fuyu x]$ rm key ; mv key.pub key
[djm@fuyu x]$ ../ssh-keygen -lf key
256 SHA256:0UH+G0Bw+ZP3rqTwxsio5CUTrKkS/kcJ26RwV3Twbyw djm@fuyu (ED25519)
Comment 2 Ismail Donmez 2015-02-23 21:06:06 AEDT
(In reply to Damien Miller from comment #1)
> I can't replicate this:
> 
> [djm@fuyu openssh]$ mkdir x
> [djm@fuyu openssh]$ cd x
> [djm@fuyu x]$ ../ssh-keygen -t ed25519 -f key -N '' -q
> [djm@fuyu x]$ ../ssh-keygen -lf ^C
> [djm@fuyu x]$ rm key ; mv key.pub key
> [djm@fuyu x]$ ../ssh-keygen -lf key
> 256 SHA256:0UH+G0Bw+ZP3rqTwxsio5CUTrKkS/kcJ26RwV3Twbyw djm@fuyu
> (ED25519)

I can't replicate like this either but I can replicate with my original key:

[~/x]> cat key
i10z.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIkPOwWQHARlE7C+wFr2dl/zUu97AUG/YpfwgpDgYH2z

[~/x]> /usr/local/bin/ssh-keygen -l -f key
Error loading public key "key": No such file or directory
256 SHA256:9BPlb4ZU9f4OP3LEz9cqYhJYR5EtefTd3PInri50Zc4 i10z.com (ED25519)
Comment 3 Ismail Donmez 2015-02-23 21:07:35 AEDT
Created attachment 2554 [details]
Problematic file
Comment 4 Damien Miller 2015-02-24 03:57:24 AEDT
Ah, I missed that it had a host prefix. I've replicated and fixed the bug (which was just the spurious error message)
Comment 5 Damien Miller 2021-04-23 15:09:20 AEST
closing resolved bugs as of 8.6p1 release