Simple shell script to synchronize a local account password across multiple systems
- POSIX shell (bash, dash, zsh, ksh, etc)
- ssh
- enable root ssh logins on all hosts to be synchronized
- configure ssh keys (or some other passwordless auth) for the root account (if you cannot ssh to the hosts as root without providing a password, this script will not work)
- create a text file with name
hosts
listing the hosts you wish to sync and save it in the same directory assynclpw
# example hosts file
server1
server2.example.net
192.168.1.10
- set the new local account password normally, i.e.,
passwd <username>
- run the script,
./synclpw <username>