If you have N number of servers and you have to change password on all server for a particular user like root or any other user you can user this script .
=> Use below script and modify according to your need !
#!/bin/bash
for server in 192.168.1.50 192.168.1.51 192.168.1.53 192.168.1.55
do
echo -e "Changing password for Server: $server"
ssh root@$server 'echo "your_new_passwd" | passwd --stdin username'
done
Note : in place of username use your username and in place of
your_new_password use your new password and change ip
according to your environment.
If you want to create Samba User Click here
Thanks
No comments:
Post a Comment