mkinitcpio-dropbear
mkinitcpio-dropbear copied to clipboard
Add a suggestion to convert keyfiles to PEM format
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
@grazzolini Any chance this can be merged?
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.