Oct 18, 2002 #1 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??
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??
Oct 18, 2002 #2 SaltyDuke Programmer Sep 18, 2002 140 IE what about passwords?? (or didi i just ask a stupid question? ) Upvote 0 Downvote
Oct 18, 2002 #3 KenCunningham Technical User Mar 20, 2001 8,475 GB 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! Upvote 0 Downvote
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!