Curtinator fails to create /etc/sudoers.d/90-cloud-init-users file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtinator |
New
|
Undecided
|
Unassigned |
Bug Description
Normally, MAAS installs include a file called /etc/sudoers.
# Created by cloud-init v. 0.7.5 on Wed, 07 Jan 2015 21:14:11 +0000
# User rules for ubuntu
ubuntu ALL=(ALL) NOPASSWD:ALL
(Presumably the date in the first line varies.) This file should be owned by root with 0440 permissions. Installations from images created by curtinator lack this file. Given the date on the comment line, I assume it's created dynamically by MAAS and something about the Curtinator image is blocking this, similar to bug #1408457; or maybe this is a bug in MAAS with respect to custom images. In any event, it would be helpful for Curtinator to create this file. As a workaround, I'm looking into doing it from the preseed.txt file.
This file, when present, enables the default "ubuntu" user to access "sudo" without a password, which is a practical necessity unless you want to publicize the default password set in the preseed.
As a workaround, the following two lines, added to the "d-i preseed/ late_command" string, just prior to the "umount /target/sys" command, fix this problem:
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /target/ etc/sudoers. d/90-cloud- init-users; \ etc/sudoers. d/90-cloud- init-users; \
chmod 0440 /target/