Creating user accounts in batch mode

In this recipe, you will see how to create multiple user accounts in batch mode without using any external tool.

Getting ready

You will need a user account with root or root privileges.

How to do it...

Follow these steps to create a user account in batch mode:

  1. Create a new text file users.txt with the following command:
    $ touch users.txt
    
  2. Change file permissions with the following command:
    $ chmod 600 users.txt
    
  3. Open users.txt with GNU nano and add user account details:
    $ nano users.txt
    
    How to do it...
  4. Press Ctrl + O to save the changes.
  5. Press Ctrl + X to exit GNU nano.
  6. Enter $ sudo newusers users.txt to import all users listed in

Get Linux: Powerful Server Administration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.