Datacentre Support Reference Guides
Visit our online shop for ALL your parts, components,
laptops, electronics and gadgets Linux: Adding multiple users in batch | |
| This ought to make peoples lives a whole lot easier. This little tip was posted in the comp.os.linux.misc newsgroup on/about 17 Aug 2000 by Peter Herttrich of Denmark. Standard problem: How to add hundreds of users with passwords without having to issue password for every single user. The standard answer for the major OSs is to use an expect script or write something in perl. Bit of a pain. Along comes Linux with the /usr/sbin/newusers program. The command takes a file that contains passwd file formatted entries for each user. The man page is a little vague on the format for the file. So, an example of the users file is included: Remember to keep the passwords in the clear and the user file @ 600 permissions. The program's damned fast too; I added 50 test users on a Pentium 200 in under 1 second. The only issue is that it doesn't automatically copy the /etc/skel/* files into the new users' home directories. Oh, well; can't have everything... | |