Skip to content

Instantly share code, notes, and snippets.

@markjfletcher
Created June 19, 2015 19:07
Show Gist options
  • Save markjfletcher/ba10a6bf733e56289575 to your computer and use it in GitHub Desktop.
Save markjfletcher/ba10a6bf733e56289575 to your computer and use it in GitHub Desktop.
Simple Add User and Set Password Script
#!/bin/bash
clear
users=(user1:pass user2:pass user3:pass)
for user in "${users[@]}"
do
password=${user##*:}
username=${user%:*}
echo Adding $username with Password $password
adduser $username
echo $user | chpasswd
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment