I have a set of users I need to add to a new system as part of a BASH script that preps my server. How can I non-interactively add the user, create their home directory, set the group, and enter a default password?
For example, if I needed to add the following users, how would I go about that?
user: node
password: spoon
group: ultraMegaPermissions
user:serve
password: spoot
group: sortaNotMega
user:watcher
password: spoogle
group: notMega
Best Answer
It's an old question, but curious, others can consider the command
newusers
. This is present on both a RHEL5.5 system and a Ubuntu 12.04 system that I use, so I'd take a guess it will be available in the repositories for most distributions.From
man newusers
: