Skip to content

Instantly share code, notes, and snippets.

@AJNOURI
Created November 7, 2018 07:18
Show Gist options
  • Save AJNOURI/bc2b3281807ce3f5db8e86315aff756d to your computer and use it in GitHub Desktop.
Save AJNOURI/bc2b3281807ce3f5db8e86315aff756d to your computer and use it in GitHub Desktop.
Create users from a script for testing purposes
#!/bin/bash
for i in $( cat users.txt ); do
useradd $i
echo "user $i added successfully!"
echo $i:$i"p@sswd" | chpasswd
echo "Password for user $i changed successfully"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment