In: Computer Science
When adding several user accounts, you might want to use the newusers utility, which can process a text file full of entries to add user accounts. Use the man or info page to find out how to use this utility, and use it to add three users. When finished, view the /etc/passwd, /etc/shadow, and /etc/group files to verify that the users were added successfully.
Syntax ********** <Username>:<Password>:<UID>:<GID>:<User Info>:<Home Dir>:<Default Shell>
Username: User login name
Password: User password
UID: User Identifier
GID: Group Identifier for user’s primary group
User Info: User information like full name, contact information
etc.
Home Dir: User’s home directory
Default Shell: User’s default shell
# cat /root/users.txt test1:test1@123:600:1530:Test User1,[email protected]:/home/tester1:/bin/bash test2:test2@123:601:1529:::/bin/bash test3:test3@123:::::
# newusers /root/users.txt
# cat /etc/passwd | grep tester test1:x:600:1530:Test User1,[email protected]:/home/tester1:/bin/bash test2:x:601:1529:::/bin/bash test3:x:65537:65538:::
# cat /etc/group | grep tester devel:x:1529:test2 test1:x:1530:test1 test3:x:65538:test3
# cat /etc/shadow | grep tester test1:$1$NK0LH/kL$.gy3tBXHUlsapiHPlPKs21:15607:0:99999:7::: test2:$1$NK0LH/kL$08Y4VdiOY4TTms.UCjjoE1:15607:0:99999:7::: test3:$1$NK0LH/kL$OkaRrrsm51tW3j5yheD7q1:15607:0:99999:7:::
if you have any doubt then please ask me without any hesitation in
the comment section below , if you like my answer then please
thumbs up for the answer , before giving thumbs down please discuss
the question it may possible that we may understand the question
different way and i can edit and change the answers if you argue,
thanks :)