In Linux, the most common method used to create new users is to use the “adduser” command. This is fine when you need to add one or even a few users, but if you need to add numerous (i.e. 50, 100, or even 500), typing in the adduser command repeatedly can be tedious.
You can simplify it to a degree by creating a flat data file that contains all of the user information and then uploading it all at once. This should shave some time off of the process and get your server ready for business a lot faster. To do this, you need to use the newusers command.
As root, enter the following:
newusers filename
The file should contain a user on each line in the following format:
loginname:password:uid:gid:comment:home_dir:shell
For example, a user named Serious Bob would look like this:
sbob:HcZ600a9:1008:1000:Serious Bob:/home/sbob:/bin/bash
Add more users on separate lines, and save the file as batch-users.txt.
Finally, run the command:
newusers batch-users.txt