From 60b4042681298eae23dff47e6a0ae81fa7022c8e Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Wed, 27 May 2020 14:17:40 +0000 Subject: [PATCH] Update adduser.sh to append new users to group --- scripts/README.md | 7 ++++--- scripts/adduser.sh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 3202499..6bcece1 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,8 +1,9 @@ ### scripts adduser.sh - Script to add new user, run with sudo if you want to configure / allow user to sudo - - `./adduser` - (Print help text) - - `./adduser ` - (Don't need sudo if new user doesn't need it) + - `./adduser` - (Prints help text) + - `./adduser ` - (Command doesn't need sudo if new user doesn't need sudo) - `sudo ./adduser ` - - `sudo ./adduser jeff 1005` - (Create jeff user and assign userID to 1005) + - `sudo ./adduser jeff 1005` - (Creates jeff user and assign userID to 1005) - Follow prompts to configure password / sudo depending on needs of new user + - After the user is created, append them to any needed groups with `sudo usermod -aG groupname username` diff --git a/scripts/adduser.sh b/scripts/adduser.sh index 15f8510..c1d00e7 100755 --- a/scripts/adduser.sh +++ b/scripts/adduser.sh @@ -19,7 +19,7 @@ printf "\nEnter 1 if $1 should have sudo privileges. Any other value will contin read choice if [ $choice -eq 1 ] ; then printf "\nConfiguring sudo for $1...\n" -sudo usermod -G sudo $1 +sudo usermod -aG sudo $1 fi printf "\nEnter 1 to set a password for $1, any other value will exit with no password set\n"