Hi,
If you want to change the password of all users in ubuntu server at a time.I have developed one good expect script that will change all users password within few seconds in whole server.Below is the script to change password of all users in ubuntu machine.
It will check for list of all users in the userlist.txt file which exists in the server.then with bash script automatically update all users password with the uniq password that you want to change.Don't forget to create userlist.txt file in the same folder where your script resides.
If you want to change the password of all users in ubuntu server at a time.I have developed one good expect script that will change all users password within few seconds in whole server.Below is the script to change password of all users in ubuntu machine.
It will check for list of all users in the userlist.txt file which exists in the server.then with bash script automatically update all users password with the uniq password that you want to change.Don't forget to create userlist.txt file in the same folder where your script resides.
#Expect Script Developed By Krunal Patel
#!/usr/bin/expect -f
read -p "Enter password that you want to set for all users: " pas
for i in `cat userlist.txt `
do
echo "$i"
echo "$i:$pas" | /usr/sbin/chpasswd
echo "User $i password changed to $pas!"
done
To download script click here
Most Important with out sudo command this script will not run ,for that you will have to pass command
sudo sh <script_name> in ubuntu.
No comments:
Post a Comment
Please give us suggestions.