From 1cc6041cd691d11b4d18c7d2ec8bf4cdf42d9931 Mon Sep 17 00:00:00 2001 From: Christopher Glass Date: Fri, 25 Aug 2017 12:05:29 +0200 Subject: [PATCH] Remove root login. Ubuntu user keeps generated password. --- live-build/ubuntu-cpc/hooks/042-vagrant.binary | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index 09edf199..1f9e5de5 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -69,11 +69,9 @@ chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-ut chroot ${mount_d} apt-get clean # Create and setup users inside the image. -# Vagrant users expect a "vagrant" user with a "vagrant" username, and that the -# root password is set to "vagrant" as well. +# Vagrant users expect a "vagrant" user with a "vagrant" username. # See https://www.vagrantup.com/docs/boxes/base.html chroot ${mount_d} useradd -m vagrant -s /bin/bash -echo "root:vagrant" | chroot ${mount_d} chpasswd echo "vagrant:vagrant" | chroot ${mount_d} chpasswd # The vagrant user should have passwordless sudo. @@ -82,7 +80,7 @@ vagrant ALL=(ALL) NOPASSWD:ALL EOF # We should permit root login with password :( -sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/g' ${mount_d}/etc/ssh/sshd_config +#sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/g' ${mount_d}/etc/ssh/sshd_config # Add the insecure vagrant pubkey to the vagrant user, as is expected by the # vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html) @@ -125,7 +123,7 @@ cdrom_vmdk_f="${box_d}/${prefix}-configdrive.vmdk" # except via local host. cat > ${seed_d}/user-data <