Browse Source

added passwordless sudo for admin

Toastie 1 year ago
parent
commit
f2582cb228
1 changed files with 4 additions and 1 deletions
  1. 4 1
      bootstrap-bullseye.sh

+ 4 - 1
bootstrap-bullseye.sh

@@ -153,10 +153,13 @@ echo "root:$pwdRoot"   | chpasswd
 echo -e "\e[1;33;4;44mPassword for the user root: $pwdRoot\e[0m"
 
 # Harden SSHD
-echo AllowUsers admin >> /etc/ssh/sshd_config
 sed -i -e 's/#Port 22/Port 50101/g' /etc/ssh/sshd_config
 sed -i -e 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
 
+# Allow admin to sudo without password
+echo AllowUsers admin >> /etc/ssh/sshd_config
+echo "admin ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/admin
+
 ## Configure network using systemd
 if [ -z $netAddress ]
 then