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

Dropbear doesn't seem to support dss keys anymore.

Open gea0 opened this issue 7 years ago • 20 comments

It seems that dropbear has dropped support for dss keys, probably for security reasons. Here https://bugs.archlinux.org/task/60523 it is mentioned that dropbear recently has improved its security.

Error output: When running mkinitcpio with the dropbear hook, i get following error:

  -> Running build hook: [dropbear]
Generating dss host key for dropbear ...
Unknown key type 'dss'
Usage: dropbearkey -t <type> -f <filename> [-s bits]
-t type	Type of key to generate. One of:
		rsa
		ecdsa
-f filename    Use filename for the secret key.
               ~/.ssh/id_dropbear is recommended for client keys.
-s bits	Key size in bits, should be a multiple of 8 (optional)
           ECDSA has sizes 256 384 521 
-y		Just print the publickey and fingerprint for the
		private key in <filename>.

Suggested fix: remove the dss key generation entirely.

gea0 avatar Nov 14 '18 17:11 gea0

PS: This error described in the above linked archlinux bug report also happend:

  -> Running build hook: [dropbear]
Error: Unrecognised key type
Error reading key from '/etc/ssh/ssh_host_rsa_key'
Error: Unrecognised key type
Error reading key from '/etc/ssh/ssh_host_dsa_key'
Error: Unrecognised key type
Error reading key from '/etc/ssh/ssh_host_ecdsa_key'

As described in the bug report, re-creating the openssh host keys with the -m PEM option fixed this. But this is probably not a bug in mkinitcpio-dropbear.

gea0 avatar Nov 14 '18 18:11 gea0

I ran into both issues as well. Thanks for the link to the dropbear bug report!

techge avatar Nov 15 '18 13:11 techge

I don't think this is a bug on this hook. But, if there's a need to change it, please let me know. I have not been using this hook, but he's now part of archlinux's [community] repo.

grazzolini avatar Mar 04 '19 21:03 grazzolini

I don't think this is a bug on this hook. But, if there's a need to change it, please let me know. I have not been using this hook, but he's now part of archlinux's [community] repo.

In the current state, the hook fails as dropbear cannot generate a dss key, does not complete all steps, so you cannot ssh afterwards. If you remove dss from the line 47 in dropbear_install for keytype in rsa dss ecdsa ; do with for keytype in rsa ecdsa ; do

it works as expected, and you can ssh afterwards

I don't think that removing dss from dropbear is a bug, so I would believe the script should be updated with this simple change.

Regards,

JeanLucJFr avatar Jun 12 '19 15:06 JeanLucJFr

@JeanLucJFr

Indeed the hook itself needs to not check for dss keys anymore. If you are able, can you create a PR for this?

grazzolini avatar Jun 12 '19 15:06 grazzolini

I sure can try :)

JeanLucJFr avatar Jun 12 '19 16:06 JeanLucJFr

@JeanLucJFr Never mind, please see #9

grazzolini avatar Jun 12 '19 17:06 grazzolini

The modification in the PR #9 is indeed cleaner. However, unless I'm mistaken, there was no merge and the modification didn't make it to the arch repository. I understand this package is not used very much, so I'm adding a note in the wiki until this is fixed.

JeanLucJFr avatar Jun 13 '19 08:06 JeanLucJFr

Yes, I need to merge the outstanding PR's to it. I have not used this hook in a while, but I'll try to merge this later and make sure it's working.

grazzolini avatar Jun 13 '19 09:06 grazzolini

I understand this package is not used very much

But there are people using it :) Thanks for efforts anyway, was to lazy to fix this yet... I just created dss keys for dropbear, I think.

techge avatar Jun 13 '19 11:06 techge

I understand this package is not used very much

But there are people using it :) Thanks for efforts anyway, was to lazy to fix this yet... I just created dss keys for dropbear, I think.

Yes, me amongst others :) It's a polite way of pointing out that the bug was not fixed since 6 monthes but that it's understandable... Anyway, the in dm-crypt specialties page of the Arch wiki now points to this thread, so there is a way for people to quickly have remote unlock up&running with dropbear.

JeanLucJFr avatar Jun 13 '19 11:06 JeanLucJFr

Ever since I've switched to tinyssh, I have been using that, hence the reason for not testing this hook properly anymore. I have now set a VM for this purpose and I should soon be able to merge and test the PR's

grazzolini avatar Jun 13 '19 12:06 grazzolini

I don't think you need to test this PR in a VM. The change is minor and straightforward, it just removes a variable and an if-branch. I have tested it multiple times.

gea0 avatar Sep 10 '19 17:09 gea0

Hi,

I tested the change in a VM and all appears well. I was able to boot, ssh and unlock remotely with the suggested change. Please can this hook be released so that others can benefit from your good work :-)

dharrigan avatar Oct 16 '19 21:10 dharrigan

Any movement on this?

yourcloudasia avatar Jun 09 '20 13:06 yourcloudasia

This issue seems to be fixed in PR #9, it would be nice with a new release though as some the Arch community package could then get the source from a more stable source.

christian-eriksson avatar Sep 30 '20 19:09 christian-eriksson

@grazzolini did you manage to set up a VM to test this? If so, could you just make a release which would then make it to downstream users? Thanks!

dumblob avatar Oct 16 '21 21:10 dumblob

@grazzolini Would you consider adding another maintainer, seeing that you don't use this hook anymore and seem to have little time for maintaining it at the moment?

coldfix avatar Oct 28 '21 08:10 coldfix

I may be willing to jump in on this if you're open to another maintainer. I do use this on half a dozen systems still and am an Arch TU to ease that end of things too. I wouldn't be able to do anything serious until mid-December though as I am traveling internationally and won't want to test on remote systems without access to fix them ;-)

alerque avatar Oct 29 '21 21:10 alerque