Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tough Question - need Help!

Status
Not open for further replies.

techangus

IS-IT--Management
Feb 7, 2002
6
CA
Given a file with the first , last names for 1000 users.
Find a way to implement these users on your linux server within 1 min.

Anyone can help me to solve this question??
 
what about passwords??

(or didi i just ask a stupid question? :) ) [pipe]
 
A version for Solaris (assuming your names are in a file called names and you wish to start with a UID of 1003 and a GID of 10):

counter=1003
x=1
for name in `cat names`
do
echo "user"$x"::"$counter":10:"$name":/export/home/"user"$x:/bin/ksh" >> /etc/passwd
mkdir /export/home/user$x
pwconv
counter=`expr $counter + 1`
x=`expr $x + 1`
done

This assumes all names are one string (eg kencunningham) and sets a null password which the user can set when first logging in.

I wouldn't recommend this approach in general terms, however!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top