From 712e64b96f8d75cc2eee9d74635a435e60dce103 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Thu, 29 Aug 2019 12:48:18 +0000 Subject: [PATCH] Add script for creating new linux users --- scripts/adduser.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/adduser.sh diff --git a/scripts/adduser.sh b/scripts/adduser.sh new file mode 100755 index 0000000..02e1e1c --- /dev/null +++ b/scripts/adduser.sh @@ -0,0 +1,16 @@ +#!/bin/bash +## Author: Shaun Reed | Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ## +## A custom bash script for creating new linux users. ## +## Syntax: ./adduser.sh ## +############################################################################### + +sudo adduser $1 --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password --uid $2 + +printf "\nEnter 1 to set a password for $1, any other value will exit with no password set\n" +read choice + +if [ $choice -eq 1 ] ; then +printf "\nChanging password for $1...\n" +sudo passwd $1 +fi +