Created
March 7, 2018 18:09
-
-
Save azbones/db02862cbfde6ae93bd094ebfc9b60f6 to your computer and use it in GitHub Desktop.
scripts for jupyterhub cis 503
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
#!/bin/bash | |
while read user pass; | |
do | |
echo "User $user read from file" | |
egrep "^$user" /etc/passwd >/dev/null | |
if [ $? -eq 0 ]; then | |
echo "$user already exists" | |
else | |
adduser $user --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password | |
echo "$user:$pass" | sudo chpasswd | |
echo Username: $user Password: $pass created | |
fi | |
done < userlist.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment