-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropbear does not work on fresh installation #83
Comments
random-archer#83 The manpage of ssh-keygen describes option "-A" as "For each of the key types (rsa, dsa, ecdsa and ed25519) for which host keys do not exist, generate the host keys [...]." But since the host keys in /etc/ssh/ already exists (because they are generated on the first invocation of sshd), nothing will be generated/regenerated/converted. Id2ndR suggested the for-loop method instead.
Hi! I just want to confirm that the problem of running The manpage of
But since the host keys in |
This is a fairly silent error that occurs because the output of the dropbearconvert wasn't checked and the return_code was still being set to zero even if dropbearconvert failed. 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. [1] random-archer/mkinitcpio-systemd-tool#83
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
I believe the for loop version of this fix does not need the |
Version used: mkinitcpio-systemd-tool 36-1.
This issue is related to #17 and https://bugs.archlinux.org/task/60523: on fresh install, ssh host_keys are generated before installing dropbear, do
mkinitcpio
show errors like this:Then, the initrd-dropbear unit seems to start on reboot, but the ssh port (22) is not binded. In fact, starting dropbear with
-E
option allows to see that it exit immediatly with return code 1:The problem is that using
ssh-keygen -A -m PEM
command, like explained in the unit, does not help because it does not replace existing keys.Solutions:
/etc/ssh/ssh_host_*key*
before using the commandssh-keygen -A -m PEM
.Then
mkinitcpio
shoud be run again.The text was updated successfully, but these errors were encountered: