Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to create 100 users at a time in solaris?

Answer Posted / satish

#!/bin/ksh

#
# Adds users from the userlist.txt file if they are not in
# /etc/passwd.
#

CURRENTUSERS=`awk -F":" '{ print $1 }' /etc/passwd`
EXPECTEDUSERS=`cat userlist.txt`
USERFOUND=0

for i in $EXPECTEDUSERS ; do
for x in $CURRENTUSERS ; do
if [ "$x" = "$i" ] ; then
USERFOUND=1
fi
done
if [ $USERFOUND -eq 1 ] ; then
echo Found user: $i
USERFOUND=0
else
/usr/sbin/useradd -d /home/$i -g wheel $i
echo Adding user: $i
sed s/$i:.*:.*:.*:.*:.*:.*:.*:/$i:XOHWcSkDQKZaA:14208:0:99999:7:::/g </etc/shadow>/etc/shadow2
cp /etc/shadow2 /etc/shadow
rm /etc/shadow2
fi
done

exit 0

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can a user login to solaris?

1112


How to solve the system hang issue.

1089


What can be a reason for the solaris system slowing down? How can it be rectified?

1069


What can be a reason for the solaris system slowing down?

994


What are nfs daemons?

1134


How can threads be created in a solaris environment?

1042


Performace degradations in NFSv4 when upgraded from NFSv3? problems with NFS v4?

2246


How to solve the system hang issue. Found that the memory state is free, commands to check and solve the issue?

1098


How do you copy files from remote system using ftp?

1122


Explain the vmstat output?

1130


How can the output be redirected to some other action process in place showing it in the screen?

1125


Explain the difference between sc> and lom>?

1012


Tell me how to set the path for core file?

1049


What kind of issues you get?

2109


How do you remove a swap space?

1088