Skip to content
duven87 edited this page Oct 10, 2018 · 1 revision

#!/bin/bash

Create account user and pass

################################ #Obtain valor variable #######################

while [ "$Username" != "Exit" ]

echo echo -e "Please enter username for account or type Exit: \c"

read Username

do

Create account of user

useradd $Username

#Check if variable had content: #######################################

if [ -z $Username ] then echo echo You didnt provide a username echo Leaving script.. exit fi

case $Username in Exit) echo Leaving script.. exit ;; *) echo echo Account for $Username is being created... ;; esac

#Define pass for the account #############################

echo Password for $Username is being set.. echo passwd $Username

Show reg. of the account

User_Record=$(grep $Username /etc/passwd)

echo echo here is $Username 's record: echo $User_Record echo

echo Account is ready for use.

done echo Leaving script... exit

Clone this wiki locally