10 ms·
OpenSSH taking minutes to become available, booting takes half an hour (2018)
- codebeaker 7y agoNeeds a (2018) at least (article date) in the headline. Although it reports an issue introduced to Linux in (2013) which was "discovered" in (2017).
- marcosdumay 7y agoThe systemd bug thread was started in 2016, closed as not a bug still in 2016, and been referenced by a lot of other bugs claiming wontfix because the problem is this one "not a bug". There are posts as lately as this year.
- pmlnr 7y ago> closed as not a bug I can't even count these any more, systemd closed it as "not a bug". I have angry words in my head.
- pmlnr 7y agoRead it. There are 2019 updates in it. And of course it's systemd, what else. (not sarcasm)
- neilwilson 7y agoThis affects Debian 10 official cloud images on various clouds - as the image doesn’t handle virt-rng out of the box
- notaplumber 7y agoIt's not just their cloud images, as far as I know Debian excludes all virtio drivers (net/disk/rnd) from all install media. It is very frustrating.
- simcop2387 7y agoI regularly do net installs of debian with virtio net and disk. I think this used to be true but it isn't anymore. Edit: looks like this is supported to at least back to debian lenny, released in 2009.
- bcoates 7y agoIs it cryptographically possible to not require randomness for an SSH server past initial key creation? If so it'd be worth doing, quality entropy is a hard ask for embedded/virtual systems.
- pstrateman 7y agoNo sshd needs to generate nonces and session keys.
- mehrdadn 7y agoYeah, I don't understand what's so cryptographically special about booting. If the system hadn't been turned off and on, it wouldn't have had a problem, right? Sounds like the real problem is some part of the system can't be bothered to persist its state. Either that, or the problem should also come up during normal usage, in which case there's a security hole somewhere.
- pstrateman 7y agosystemd isn't using the right interface for adding the entropy in the seed file, so the kernel uses it but counts it as zero bits of entropy edit: but i guess that's on purpose to handle disk imaging
- mehrdadn 7y agoYeah I was just reading that. Why was that not an obvious bug to be fixed immediately? I haven't read much of the GitHub issues but it seems so weird to recommend trusting the CPU RNG instead of just pushing out a quick fix...
- raverbashing 7y ago> Why was that not an obvious bug to be fixed immediately? Welcome to SystemD
- Hello71 7y ago
- buildzr 7y agoVery disappointing to hear that Debian and some other distros enabled CONFIG_RANDOM_TRUST_CPU. I'd rather not be relying on Intel hardware to do something so important correctly.
- pmlnr 7y agoYou'd rather rely on... systemd?
- fooker 7y agoAn open source software stack vs a Frankenstein Minix running with mysterious powers over your computer, do you even have to ask?
- bwvfr 7y agoAn open source software stack programmed by Poettering.
- AlotOfReading 7y agoThe management engine doesn't have anything to do with RDRAND. What's your point here?
- kroeckx 7y agoWhy do you trust Intel less then any other hardware RNG you might have? Do you trust the one in the TPM? Or do you just not trust hardware to collect entropy?
- wiredfool 7y agoI’ve had docker take 5 minutes to start on a cloud server due to entropy starvation. Iirc it’s somewhat kernel version dependent between the later 4.x kernels and the older xenial default kernel.
- AaronFriel 7y agoIs this because there is 0 entropy available at boot and therefore even /dev/urandom is unavailable? Or is this because legacy tools are still relying on the concept of being able to "drain" the entropy pool? I'm not sure which the "getrandom()" call is related to.
- agl 7y agogetrandom blocks until 128 bits of entropy have been collected since boot. It doesn't have the concept of "draining" the pool after the pool has been initialised.
- kroeckx 7y agoThe problem with /dev/urandom is that it's always available, even before any entropy was added. Fixing /dev/urandom to block until enough entropy is available once causes breakage like in the article. That is one of the reasons why getrandom() was added, so that existing applications can keep using the old and broken behavior but applications that care about the RNG being properly initialized can wait for it. So software that does crypto switched to it, and then things broke anyway.
- cat199 7y ago> Fixing /dev/urandom to block until enough entropy is available once causes breakage like in the article. ... not to mention it is the entire point of /dev/urandom .. if you want something to block for entropy, you use /dev/random. if you are using /dev/urandom, you are saying I want something 'randomly random' and I'm okay if I can't get something random enough..
- plq 7y agoI'm so happy I've stayed with Gentoo and never had to bother with this systemd thing that everyone is talking about.
- kroeckx 7y agosystemd didn't change much related to this. The seed file never got credited, at least not in Debian. So either you have the same problem on Gentoo, or Gentoo has other problems.
- notaplumber 7y agoIt doesn't on OpenBSD. arc4random(3) simply can not fail, and getentropy(2) does not block. Linux screwed up getrandom. High quality random numbers are available very early in the OpenBSD kernel, and there is no early boot problem for userland. Linux has an opportunity to learn from OpenBSD. https://www.openbsd.org/papers/hackfest2014-arc4random/index.html https://www.openbsd.org/papers/hackfest2014-arc4random/index...
- throw0101a 7y ago> High quality random numbers are available very early in the OpenBSD kernel, and there is no early boot problem for userland. OpenBSD also controls its own boot loader, which also feeds in entropy that the kernel then leverages. Perhaps GRUB(2) should do something similar?
- cat199 7y agoyou mean you haven't heard of /etc/grub.conf.d/entropy.d/randomseed.d/grub-entropy-randomseed.conf and it's good buddy systemd-enable-grub-conf-d-entropy-d-randomseed-d.target ?
- deathanatos 7y agoSeems like they store entropy in an on-disk file[1], and re-read that file on startup. This feature is available in Linux as well (see urandom(4) for an example of how to do it manually, though I think most distros bundle this in some manner); although apparently, according to the OP, it doesn't fully work? Seems like the man page sort of notes the problem in the article: > Writing to /dev/random or /dev/urandom will update the entropy pool with the data written, but this will not result in a higher entropy count. But, why not, man page, why not? I feel like if I, as root, write to /dev/random, I am saying that this is acceptable input for seeding the generator, and that it is on me to not, say, seed it with the exact same stuff every boot, or seed it with straight nuls, no? How does OpenBSD guarantee that this file exists, though? Perhaps making it a system default is wise, but what about brand new VMs/installs? Does the install just take the time to do the first generation of that file? The OpenBSD folks also appear to trust RDRANG, which would help not blocking. But I disagree with that trust decision. [1]: start reading here: https://www.openbsd.org/papers/hackfest2014-arc4random/mgp00019.html https://www.openbsd.org/papers/hackfest2014-arc4random/mgp00...
- peeters 7y agoMost fun bug I've ever fixed is when we had builds time out while running unit tests, but it would never happen on our dev machines. Unless we let it run while grabbing a coffee. Or if we just sat there watching the screen without touching the mouse. But as soon as we would touch the mouse it would resume. ...tl;dr quick change to Java property so that SecureRandom uses /dev/urandom instead of /dev/random and problem solved.
- 0815test 7y agoHave you tried wiggling your mouse? It worked wonders for me, back when I was on Windows 95!
- DonHopkins 7y agoMaybe AWS can hook up a Mechanical Turk service to AWS so real live people can generate entropy by wiggling mice over the internet.
- DonHopkins 7y agoTIL Linux launches a built-in denial-of-service attack on itself every time it reboots!
- dfeojm-zlib 7y ago1. /etc/ssh/sshd_config: UseDNS no 2. If haveged isn't perfect enough, setup a hw TRNG (i.e., EntropyKey, BitBabbler, InfiniteNoise) and EGD or EntropyBroker. https://everipedia.org/wiki/lang_en/Comparison_of_hardware_random_number_generators https://everipedia.org/wiki/lang_en/Comparison_of_hardware_r... http://egd.sourceforge.net http://egd.sourceforge.net https://www.vanheusden.com/entropybroker https://www.vanheusden.com/entropybroker 3. It maybe something else.
- emmelaich 7y ago> UseDNS no Is not sufficient by itself to never have any part of the ssh connection and authentication not use DNS. See https://unix.stackexchange.com/questions/56941/what-is-the-point-of-sshd-usedns-option https://unix.stackexchange.com/questions/56941/what-is-the-p... and https://serverfault.com/questions/576293/sshd-tries-reverse-dns-lookups-with-usedns-no https://serverfault.com/questions/576293/sshd-tries-reverse-...
- jwilk 7y agoAnd "UseDNS no" is the default anyway.
- stevenicr 7y agoHad similar years ago on a box and found out the disk(s) were 99.99% full - took forever to whittle it down.
- hnarn 7y agoNo monitoring? :(