script for creating multiple users
Being the penultimate lazy sysadmin I thought I'd ask here before I delve into writing a script. What I need is a script for adding multiple users using the "useradd" command. I'm going to be adding about 250 users but they will not all be going onto the same box. Some are going onto Solaris machines and some onto AIX machines. Besides I'd hate to have to use "SMIT" to manually add 250 users. I'm thinking of writing a script that will use "foreach" to loop through a file with the username and gecos field to create the entry in /etc/passwd and to use the UID 35000 as the base UID for all of the rest and increment from 35000 by 1 for each user added, then run the password program to create a temporary password for the user that expires when they login. Does someone already have something like this written? Would it be as easy as I've set out? I'm testing the draft of the script on a Linux box and would tune it for Solaris and AIX when I ported them over.