Re: vim -- adduser vs useradd/usermod
On 11/25/12, Wolf Halton <email@example.com> wrote:
> usermod makes changes to user.
> useradd is not interactive, so makes an automated script for adding many
> users more possible to write. including setting nonstandard home directory
> or extra groups.
> adduser is interactive but does not let you put a user in multiple groups,
> i don't think.
# as an extra step of course,
# choose list of groups you want the user to be in:
groups="adm disk sound scanner etc"
# then, add that user to each group:
for g in $groups; do adduser $theuser $g; done
# or do it this way (and other ways for sure):
echo $groups | xargs -n 1 adduser $theuser