two ssh-client module fixes
cover two ssh-client module fixes
1/2: remove cttyhack checking
2/2: add random feeding code
--- modules.d/95ssh-client/module-setup.sh | 10 ++-------- modules.d/95ssh-client/random-seeding.sh | 7 +++++++ 2 files changed, 9 insertions(+), 8 deletions(-)
PATCH 1/2 ssh-client: remove ctty related check
cttyhack was removed and ctty is supported by default, so no need to check it in ssh-client module any more.
--- modules.d/95ssh-client/module-setup.sh | 8 -------- 1 file changed, 8 deletions(-)
modules.d/95ssh-client/module-setup.sh +0 -8
@@ -15,9 +15,6 @@ check() { derror "ssh key: $sshkey is not found!" return 1 } - [[ ! $cttyhack = yes ]] && { - dinfo "--ctty is not used, you should make sure the machine is a knownhost and copy the sshkey to remote machine!" - } fi return 255
@@ -50,11 +47,6 @@ inst_sshenv() } install() { - [[ ! $cttyhack = yes && ! $sshkey ]] && { - derror "ssh-client needs option --ctty or --sshkey!" - return 1 - } - dracut_install ssh scp inst_sshenv }
PATCH 2/2 ssh-client: add urandom seeding
In reply to [email protected]openssh usually depends on /dev/urandom to seeding PRNG (pseudo-random number generator). To ensure there's sufficient entropy just feed /dev/urandom with saved /var/lib/random-seed which is saved in installing phase.
--- modules.d/95ssh-client/module-setup.sh | 2 ++ modules.d/95ssh-client/random-seeding.sh | 7 +++++++ 2 files changed, 9 insertions(+)
modules.d/95ssh-client/module-setup.sh +2 -0
@@ -48,6 +48,8 @@ inst_sshenv() install() { dracut_install ssh scp + dracut_install /var/lib/random-seed + inst_hook cmdline 01 "$moddir/random-seeding.sh" inst_sshenv }
modules.d/95ssh-client/random-seeding.sh new file +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +if [ -f /var/lib/random-seed ]; then + cat /var/lib/random-seed > /dev/urandom 2>/dev/null +fi
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveHmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveQuoted 3 lines · Harald Hoyer
Hmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?
This is intend to resolve the no-sufficient-entropy issue during ssh connection. But, yes it's same across reboot if the initrd is not regenerated.
In old kdump code we originally copy bytes from /dev/mem, but that is not good because /dev/mem is access denied, also it's not so random as well.
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Thanks Dave
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveQuoted 7 lines · Dave Young
Quoted 3 lines · Harald Hoyer
Hmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?
Quoted 6 lines
This is intend to resolve the no-sufficient-entropy issue during ssh connection. But, yes it's same across reboot if the initrd is not regenerated.
In old kdump code we originally copy bytes from
/dev/mem, but that is not good because/dev/memis access denied,
BTW, the access denying problem is only limited to s390 arch
Quoted 9 lines
also it's not so random as well.
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Thanks Dave
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveQuoted 3 lines · Harald Hoyer
Hmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?
Atleast it can help with kdump where we might regenerate the initramfs upon user config change and capture the new seed.
Also kdump does not happen often on the machine. So I guess for once in a while operation it is still better to use random-seed then not using anything at all.
Thanks
Vivek
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveQuoted 11 lines · Vivek Goyal
Quoted 3 lines · Harald Hoyer
Hmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?Atleast it can help with kdump where we might regenerate the initramfs upon user config change and capture the new seed.
Also kdump does not happen often on the machine. So I guess for once in a while operation it is still better to use random-seed then not using anything at all.
For normal boot case, I think something like systemd-random-seed-load.service is fine because rootfs is always mounted in initramfs. But I'm not sure how to handle the mount issue if /var/lib if mounted to another partition.
Or simply add below to pre-pivot hook:
if [ -f /proc/vmcore ]; then
cat /var/lib/random-seed > /dev/urandom
else
if [ -f /sysroot/var/lib/random-seed ]; then
cat /sysroot/var/lib/random-seed > /dev/urandom
fi
fi
Harald, what do you think?
Quoted 3 lines
Thanks
Vivek
Signature · 2 lines
Thanks Dave
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveQuoted 22 lines · Dave Young
Quoted 11 lines · Vivek Goyal
Quoted 3 lines · Harald Hoyer
Hmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?Atleast it can help with kdump where we might regenerate the initramfs upon user config change and capture the new seed.
Also kdump does not happen often on the machine. So I guess for once in a while operation it is still better to use random-seed then not using anything at all.
For normal boot case, I think something like systemd-random-seed-load.service is fine because rootfs is always mounted in initramfs. But I'm not sure how to handle the mount issue if
/var/libif mounted to another partition.Or simply add below to pre-pivot hook:
Quoted 8 lines
if [ -f
/proc/vmcore]; then
cat/var/lib/random-seed>/dev/urandom
else
if [ -f /sysroot/var/lib/random-seed ]; then
cat /sysroot/var/lib/random-seed >/dev/urandom
fi
fi
Or how about doing it rhel6 way. Let kdump module pack in /var/lib/random-seed in kdump initramfs and if this file is present, feed it to /dev/urandom.
Thanks
Vivek
Re: [patch 2/2] ssh-client: add urandom seeding
In reply to a message not in the archiveQuoted 32 lines · Vivek Goyal
Quoted 22 lines · Dave Young
Quoted 11 lines · Vivek Goyal
Quoted 3 lines · Harald Hoyer
Hmm, wouldn't that mean, that the generator is seeded with the _same_ seed on every reboot?
How is this different from booting with no seed at all?Atleast it can help with kdump where we might regenerate the initramfs upon user config change and capture the new seed.
Also kdump does not happen often on the machine. So I guess for once in a while operation it is still better to use random-seed then not using anything at all.
For normal boot case, I think something like systemd-random-seed-load.service is fine because rootfs is always mounted in initramfs. But I'm not sure how to handle the mount issue if
/var/libif mounted to another partition.Or simply add below to pre-pivot hook:
Quoted 8 lines
if [ -f
/proc/vmcore]; then
cat/var/lib/random-seed>/dev/urandom
else
if [ -f /sysroot/var/lib/random-seed ]; then
cat /sysroot/var/lib/random-seed >/dev/urandom
fi
fi
Quoted 3 lines
Or how about doing it rhel6 way. Let kdump module pack in
/var/lib/random-seedin kdump initramfs and if this file is present, feed it to/dev/urandom.
Ok, will add this in kdump module instead.
Harald, please ignore patch 2/2 then.
Quoted 3 lines
Thanks
Vivek
Signature · 2 lines
Thanks Dave