We have a number of Red Hat linux servers in our IT environment. I am being asked by my team members to write a script (preferably shell script) to change a user\'s password
Building on squashbuff's example, I tried the following, which worked well for me:
#!/bin/bash for server in `cat hostlist`; do echo $server; ssh username@$server 'passwd <<EOF old_password new_password new_password EOF'; done
Security wise, Could be improved to take input without echoing to the screen OR saving the plaintext to disk.