Saturday, June 26, 2021

Script to Change Password for a Particular User on Remote Server

 

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

Installing Jenkins on RHEL 8 is a straightforward process. Here's a step-by-step guide

Introduction  Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD) pipelines...