There are a number of cluster commands that allow performing operations on all cluster nodes at once, e.g. cexec
, as in cexec mkdir /scratch/something
.
How can I change the password on all nodes at once for a user?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThere are a number of cluster commands that allow performing operations on all cluster nodes at once, e.g. cexec
, as in cexec mkdir /scratch/something
.
How can I change the password on all nodes at once for a user?
This should work:
for i in serverlist;do
ssh $i "usermod --password $(echo my_new_password | openssl passwd -1 -stdin) USERNAME"
done
usermod doesn't prompt but the password needs to be encrypted first.