01.as_root-add_user_to_groups.ksh 361 B

1234567891011121314
  1. #!/bin/ksh
  2. print -n "Enter user name: ";read -r username; print ""
  3. # Normal user configuration
  4. #Add normal user to the wheel and wsrc groups
  5. usermod -G operator $username
  6. usermod -G staff $username
  7. usermod -G wheel $username
  8. usermod -G wsrc $username
  9. usermod -G games $username
  10. #Make sure you belong to the class (not group) staff:
  11. usermod -L staff $username