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: nodepassword: spoongroup: ultraMegaPermissionsuser:servepassword: spootgroup: sortaNotMegauser:watcherpassword: spooglegroup: notMega
How should I add users non-interactively?
bash;useradd
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 available in the repositories for most distributions.From 'man newusers'The newusers command reads a file of user name and clear-text password     pairs and uses this information to update a group of existing users or     to create new users. Each line is in the same format as the standard     password file (see passwd(5)) with the exceptions explained below