00.as_root-remove_doas_password.ksh 454 B

123456789101112
  1. #!/bin/ksh
  2. print -n "Enter user name: ";read -r username; print ""
  3. print "permit keepenv nopass $username" >>/etc/doas.conf
  4. #Allow user to run commands as root
  5. #print "permit persist keepenv :wheel" >>/etc/doas.conf
  6. #print "permit persist keepenv :wsrc" >>/etc/doas.conf
  7. #Allow user mounting of an external USB stick
  8. print "permit nopass $username as root cmd mount" >>/etc/doas.conf
  9. print "permit nopass $username as root cmd umount" >>/etc/doas.conf