creating remoteuser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all

I m making script to automate remote server user creation, using sudo,
this is my sript, something is not working out or parts missing, am
very new 2 bash scripting, plz help
Am not able to complete the script, plz tell me where i am going wrong...

Thanks a lot

---------------------------------------------------------------------------------------------------------------------
echo Checking for the user file
echo
grep ^$1: /home/dj/list > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
        echo " User file not found" >&2
        exit 1
fi
echo
echo -e "Enter Hostname:"
read -e HOST
PASSWORD="test"
NEW_USERS="/home/dj/list"
cat ${NEW_USER}|\
while read USER GROUP PASSWORD FULL NAME
do
#echo  "Enter Hostname"
#read -e HOST
ssh $HOST |\
sudo /usr/sbin/useradd -G ${GROUP} -p ${PASSWORD} ${USER} -c "${FULL} ${NAME}"
$PASSWORD
done
-----------------------------------------------------------------------------------------------------------------------

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux