Useradd2 Script

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

https://www.rootusers.

com/lvm-resize-how-to-decrease-an-lvm-partition/

for user in mfarooq07 ; do verify=`cat /etc/passwd | grep -w $user | wc -l`;


string=`uname -a`; if ((verify == 0)); then echo "Creating Account of $user"; if [[
$string == *"Sun"* ]]; then useradd -s /bin/bash -m -d /export/home/$user $user &&
passwd $user; passwd -f $user; else useradd -s /bin/bash -m -d /home/$user $user &&
passwd $user; chage -d 0 $user; fi; else echo "User $user already exists. Changing
password of $user"; if [[ $string == *"Sun"* ]]; then passwd $user; passwd -u
$user; passwd -f $user; else passwd $user; passwd -u $user; chage -d 0 $user; fi;
fi; done

ibashir, maziz01, nhamid, mnasir, acheema, mhabib, msaqib, azahid, masif05,


mchughtai01, mnaeem02, mtahir04, mfahad01, hiqbal01, hhussain, snizam, abatool,
mali13, atariq01, krana01, hahmed01, trana

You might also like