I have to create multiple users in an Ubuntu environment from a csv file that lists their names and password. I am using the following tutorial

Import users from CSV file

But I am not been able to run newsusers command successfully. I get the following ERROR message

newusers: group 'tom' is a shadow group, but does not exist in /etc/group
newusers: line 1: can't create group
newusers: error detected, changes ignored

Here is the format of my csv file


Also note that i have a csv file not : delimited file. I am also wondering how to communicate the password to multiple users if they are more than 100.

The output from running sudo grpck -r is

$sudo grpck -r
no matching group file entry in /etc/group
delete line 'tom:*::'? No
grpck: no changes

Please note that if i don't specify home directory like /home/tom in the csv file, it is NOT created. Is there a way to create it by default?


After deleting Tom per @steeldriver's suggestion, when i run the newusers command, i get the following

$ sudo newusers < test.txt 
[sudo] password for oper: 
newusers: (user tom) pam_chauthtok() failed, error:
Authentication token manipulation error
newusers: (line 1, user tom) password not changed
newusers: (user danny) pam_chauthtok() failed, error:
Authentication token manipulation error
newusers: (line 2, user danny) password not changed
  • It's possible there's a mismatch between the group file and its shadow: can you run sudo grpck -r and edit your post to include any output please? Aug 31 '15 at 22:44
  • So, my guess is that you followed the first, top answer, where it says "You will need to create a file with this format:" and created the file where you specified the group for that user, is that correct ? Aug 31 '15 at 22:57
  • @steeldriver The post is updated per your suggestion Sep 1 '15 at 15:35
  • @Serg The post is updated Sep 1 '15 at 15:35
  • Well if group tom is just something you created as a test, then you can run grpck again without the -r and answer 'Yes' when prompted to delete it. Sep 1 '15 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.