0

This question already has an answer here:

I need to add many users on a Ubuntu machine. Is there a way to add a list of users using a text file?

When using adduser it always asks for an individual password and extra information, else I would do something like

while read p; do sudo adduser $p; done < users.txt

where users.txt contains something like:

username1
username2
...

Edit:
So the referenced solution is one step forward:

while read p; do sudo adduser --disable-password --gecos "" $p; done < users.txt

However I cannot set a default password for all of the users in the list. Else I would have to manually set a password for every user. Any idea how to fix that?

marked as duplicate by muru bash Jul 24 '18 at 9:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.