move aurbuilder sudo right to /etc/sudoers.d/aurbuilder
This commit is contained in:
parent
495d1d3b3e
commit
3c2314a07d
2 changed files with 5 additions and 3 deletions
|
@ -48,7 +48,9 @@ case $sel in
|
||||||
sudoers=$(ls /etc/sudoers.d)
|
sudoers=$(ls /etc/sudoers.d)
|
||||||
sudoerlist=()
|
sudoerlist=()
|
||||||
for itm in $sudoers; do
|
for itm in $sudoers; do
|
||||||
|
if [ ! "$itm" = "aurbuilder" ]; then
|
||||||
sudoerlist+=("$itm" "")
|
sudoerlist+=("$itm" "")
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
sel=$(whiptail --backtitle "$apptitle" --title "Delete sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \
|
sel=$(whiptail --backtitle "$apptitle" --title "Delete sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \
|
||||||
"${sudoerlist[@]}" \
|
"${sudoerlist[@]}" \
|
||||||
|
|
|
@ -45,8 +45,8 @@ checkaurdependencies(){
|
||||||
newpass=$(< /dev/urandom tr -dc "@#*%&_A-Z-a-z-0-9" | head -c16)
|
newpass=$(< /dev/urandom tr -dc "@#*%&_A-Z-a-z-0-9" | head -c16)
|
||||||
useradd -r -N -M -d /home/.aurbuilder -s /usr/bin/nologin aurbuilder
|
useradd -r -N -M -d /home/.aurbuilder -s /usr/bin/nologin aurbuilder
|
||||||
echo -e "$newpass\n$newpass\n"|passwd aurbuilder
|
echo -e "$newpass\n$newpass\n"|passwd aurbuilder
|
||||||
echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aurbuilder
|
||||||
echo "root ALL=(aurbuilder) NOPASSWD: ALL" >> /etc/sudoers
|
echo "root ALL=(aurbuilder) NOPASSWD: ALL" >> /etc/sudoers.d/aurbuilder
|
||||||
newpass=""
|
newpass=""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue