Polish up sudo configs
This commit is contained in:
parent
b4637075bf
commit
ef8aa32fd9
10
archstrap.sh
10
archstrap.sh
@ -122,15 +122,19 @@ arch-chroot-configure() {
|
||||
# Secondary packages
|
||||
pacman -S sudo
|
||||
cat <<-EOF >> "/etc/sudoers"
|
||||
%wheel ALL=(ALL) ALL
|
||||
%sudo ALL=(ALL) ALL
|
||||
ansible ALL=(ALL) NOPASSWD:ALL
|
||||
EOF
|
||||
# Create sudo group
|
||||
if ! grep -e '^sudo:' /etc/group; then
|
||||
groupadd sudo
|
||||
fi
|
||||
# Configure my user
|
||||
if ! id salt > /dev/null 2>&1; then
|
||||
useradd salt -m -G wheel -s /bin/bash -u 1000 -U
|
||||
useradd salt -m -G sudo -s /bin/bash -u 1000 -U
|
||||
passwd salt
|
||||
fi
|
||||
for group in wheel; do
|
||||
for group in sudo; do
|
||||
usermod -G "$group" -a salt || warn "Failed to add salt to group: $group"
|
||||
done
|
||||
# Configure Ansible user
|
||||
|
Loading…
Reference in New Issue
Block a user