Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automate adding multiple users and add them to single group on linux system
#/bin/bash
groupadd developer
_USERS='admin '
for _USER in ${_USERS}
do
useradd ${_USER} -mN -G developer
done
for _USER in ${_USERS}
do
echo ${_USER} | passwd ${_USER} --stdin
done
# usermod -aG wheel admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment