Created
March 25, 2020 09:12
-
-
Save Akasurde/1bdeb1df272db4d2b8760e2fcce5c6c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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 |
This file contains hidden or 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
abhijeet:mysupersecretpasswrd | |
rahesh:mysecret@123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment