Created
November 13, 2011 17:59
-
-
Save rtacconi/1362404 to your computer and use it in GitHub Desktop.
How to change a user password as root with expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
spawn passwd [lindex $argv 0] | |
set password [lindex $argv 1] | |
expect "password:" | |
send "$password\r" | |
expect "password:" | |
send "$password\r" | |
expect eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment