Last active
April 16, 2018 16:23
-
-
Save grenade/6317902 to your computer and use it in GitHub Desktop.
Create multiple new user accounts on Linux, set passwords to match usernames, force password change at first login and add users to some-user-group.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for username in foo bar baz qux | |
do | |
/usr/sbin/useradd $username | |
echo $username | passwd $username --stdin | |
chage -d 0 $username | |
/usr/sbin/usermod -a -G some-user-group $username | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment