"sshd_keygen: key_load_public: invalid format" on a fresh image

1,336 views
Skip to first unread message

David Resnick

unread,
Jul 2, 2015, 3:22:21 PM7/2/15
to coreo...@googlegroups.com
4 out of 5 images I just deployed won't let me login with the ssh key I set in a cloud-config file.

The key used is the same for all images; this is something I've done successfully many times before.

The log has "sshd_keygen[501]: key_load_public: invalid format" 3 times followed by sshd with the same failure. The 8 files matching /etc/ssh/ssh_host* are all zero length.

CoreOS 717.1.0 deployed on VMware vCloud Air.

Any ideas on what's going on here? Any way to salvage the deployed images, or to prevent this from happening again?

- David

Michael Marineau

unread,
Jul 2, 2015, 3:26:15 PM7/2/15
to David Resnick, coreos-user
I've genenerally only seen this when killing a VM shortly after boot,
after the new key files have been created but before their contents
actually get flushed to disk. Was the first boot of all these
instances clean? If no failure of the VM was involved I'm not yet sure
how this would happen.
> --
> You received this message because you are subscribed to the Google Groups
> "CoreOS User" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to coreos-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Resnick

unread,
Jul 2, 2015, 3:59:26 PM7/2/15
to coreo...@googlegroups.com, abun...@gmail.com
Your explanation makes sense, the VMs were created with a script which cycles the power 25 seconds after creation. I'll increase the time.

Thanks for your help!

- David

Michael Marineau

unread,
Jul 2, 2015, 4:14:57 PM7/2/15
to David Resnick, coreos-user
I would highly recommend using a graceful shutdown instead. ext4 may
be relatively robust against improper shutdown but it isn't magic :)
Reply all
Reply to author
Forward
0 new messages