On Tue, 2003-12-23 at 09:35, Raj Shekhar wrote: > On Mon, 2003-12-22 at 13:31, s nagar wrote: > > hi everyone > > > > i need to ask you one thing > > that whether it is possible to create users in bulk rather than creating single > > user > > in case there are many users to be created and simultaneously giving them same > > password as their username. > > in case you have some solution then please do reply. > > There is a utility called 'useradd' which comes with the shadow-utils > package. You can use it either interactively or pass it the options > using the command line. The main options for you would be > > useradd [-p passwd] [-s shell] login-name > > You can use this utility in your shell script. Use the shell script to > read a user name from the txt file, use useradd to create the user. If > you try google, I think you may come across scripts which do this. As root create a file as: #!/bin/bash useradd -c "NAME SURNAME" -d "/home/directory/path" -p "password" loginname" repeat lines for all users finish editing chmod +x filename ./filename
This will add all users listed in the file on the fly. You can further modify by leaving actual addition to a script file and that files in turn reading the "data" from this file. If no password needs o be set then use -p "" You can also add groups by using -g "groupname". man useradd for more. -- Sudev Barar Learning Linux _______________________________________________ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
