Skip to content

Instantly share code, notes, and snippets.

@FruitieX
Created January 9, 2015 14:11
Show Gist options
  • Save FruitieX/1bf7834cfd31cd7cb1c2 to your computer and use it in GitHub Desktop.
Save FruitieX/1bf7834cfd31cd7cb1c2 to your computer and use it in GitHub Desktop.
IFS=$'\n'
for line in $(cat openstackusers.txt); do
user=$(echo $line | cut -d' ' -f1)
pwd=$(echo $line | cut -d' ' -f2)
# add user
sudo useradd -m $user
# set user password
echo -e "$pwd\n$pwd" | sudo passwd $user
# remove users by uncommenting
#sudo userdel $user
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment