mkinitcpio-dropbear icon indicating copy to clipboard operation
mkinitcpio-dropbear copied to clipboard

Add a suggestion to convert keyfiles to PEM format

Open ghthor opened this issue 3 years ago • 2 comments

This commit adds additional output to the following Error message informing the user they need to convert their existing ssh_host key files to PEM format.

Error: Unsupported OpenSSH key type
Error reading key from '/etc/ssh/ssh_host_rsa_key'
Error: Unsupported OpenSSH key type
Error reading key from '/etc/ssh/ssh_host_ecdsa_key'

I found the suggestion to convert the existing keys to PEM format in an issue[1] for systemd-tool and I've converted the suggestion to an echo statement during a failure to convert the keys when running mkinitcpio when dropbear hook is enabled.

Also this change stops swallowing this error. The new behavior is, if dropbear convert was unable to convert any existing ssh_host key files then generate_keys will be run. This prevents an initramfs being generated without any host keyfiles. This is the same behavior that occurs when NO existing ssh_host keyfiles exist.

[1] random-archer/mkinitcpio-systemd-tool#83

ghthor avatar Sep 26 '21 20:09 ghthor

@grazzolini Any chance this can be merged?

ghthor avatar Dec 17 '21 03:12 ghthor

There is more that could be done, but at least this helpful output would be a good stop-gap while a longer term solution is considered. I agree this should be merged.

c.f. #12.

alerque avatar Dec 17 '21 16:12 alerque