Bash scripts to change passwords on remote servers.
I have systems that are secured with PAM authentication / SSH. When attempting to execute “passwd” commands remotely with SSH, the system does not allow this. These systems are setup with Public Key Authentication, and NOPASSWD option in /etc/sudoers. Script 1 – This script runs from a management server. It copies “local” script out to the servers, then executes the script with ssh / sudo, then deletes the script when complete. #!/bin/bash HOSTREAD=$(cat /opt/scripts/hosts.txt) USR="forgotten&…
