Fixed permissions on sudoers file.

This commit is contained in:
Scott Duensing 2025-06-12 18:32:21 -05:00
parent f08d740969
commit a0d9ce083e
2 changed files with 4 additions and 2 deletions

View file

@ -7,8 +7,8 @@ function rebootMachine() {
machine="0${machine}"
fi
machine="chrome${machine}.duensing.digital"
echo "Attempting reboot of ${machne}..."
sshpass -p password ssh -o "StrictHostKeyChecking=no" user@${machine} "reboot"
echo "Attempting reboot of ${machine}..."
sshpass -p password ssh -o "StrictHostKeyChecking=no" user@${machine} "sudo reboot"
}

View file

@ -38,5 +38,7 @@ function unsafeUpdateRoot() {
# Allow 'user' to reboot machine.
if [[ ! -f /etc/sudoers.d/userreboot ]]; then
echo 'user ALL = NOPASSWD: /usr/sbin/halt, /usr/sbin/reboot, /usr/sbin/poweroff' > /etc/sudoers.d/userreboot
chown root:root /etc/sudoers.d/userreboot
chmod a-w /etc/sudoers.d/userreboot
fi
}