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:
- Create a new text file
users.txt
with the following command:$ touch users.txt
- Change file permissions with the following command:
$ chmod 600 users.txt
- Open
users.txt
with GNU nano and add user account details:$ nano users.txt
- Press Ctrl + O to save the changes.
- Press Ctrl + X to exit GNU nano.
- 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.