Skip to content

Instantly share code, notes, and snippets.

@Akasurde
Created March 25, 2020 09:12
Show Gist options
  • Save Akasurde/1bdeb1df272db4d2b8760e2fcce5c6c7 to your computer and use it in GitHub Desktop.
Save Akasurde/1bdeb1df272db4d2b8760e2fcce5c6c7 to your computer and use it in GitHub Desktop.
for i in `cat user.txt`
do
user=`echo $i | awk -F ":" '{print $1}'`
password=`echo $i | awk -F ":" '{print $2}'`
echo "Changing password for ${user}"
echo "${password}" | passwd --stdin ${user}
if [ $? -eq 0 ]; then
echo "Password changed for ${user}"
else
echo "Failed to change password for ${user}"
fi
done
abhijeet:mysupersecretpasswrd
rahesh:mysecret@123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment