This commit is contained in:
luk.lu
2022-11-15 14:05:27 +08:00
parent 7f15783d70
commit cda2881cf5
3 changed files with 20 additions and 18 deletions

View File

@@ -41,14 +41,18 @@ echo "=== Configure root home"
source /faronear/fon/sysconfig/home-config.sh /faronear/fon/sysconfig/nixhome
echo
echo "=== Change root password"
passwd
echo "=== Change root password? <y> for yes, anything else for omit:"
read -p ">>> " ChangeRootPassword
if [ "$ChangeRootPassword" == 'y' ]
then
passwd
fi
echo
echo "=== Configure /etc/sudoers"
chmod o+w /etc/sudoers
#sed -i "s|%sudo\s\+ALL=(ALL:ALL)\sALL|%sudo\tALL=(ALL:ALL) NOPASSWD:ALL|g" /etc/sudoers # allow all users in %sudo group to sudo without password
sed -i "s|#includedir /etc/sudoers.d|includedir /etc/sudoers.d|g" /etc/sudoers # allow users in /etc/sudoers.d/ folder to sudo
sed -i "s|#includedir /etc/sudoers.d|@includedir /etc/sudoers.d|g" /etc/sudoers # allow users in /etc/sudoers.d/ folder to sudo
chmod o-w /etc/sudoers
echo