From 61d37a71f4e9ad8ed29945d633d2c1acd041e677 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Mon, 10 Jul 2023 19:36:12 +0200 Subject: [PATCH] disable root password --- recipes-extended/sudo/sudo_%.bbappend | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes-extended/sudo/sudo_%.bbappend b/recipes-extended/sudo/sudo_%.bbappend index 1e3a036..b392948 100644 --- a/recipes-extended/sudo/sudo_%.bbappend +++ b/recipes-extended/sudo/sudo_%.bbappend @@ -1,4 +1,9 @@ do_install:append() { # grant all permission to sudo group sed -i 's/^#\s*\(%sudo\s*ALL=(ALL:ALL)\s*ALL\)/\1/' ${D}/${sysconfdir}/sudoers + # allow sudo group to power off/reboot system without password + cat << EOF >> ${D}/${sysconfdir}/sudoers +## sudo user group is allowed to execute halt and reboot +%sudo ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff +EOF } \ No newline at end of file