Created
November 20, 2012 17:22
-
-
Save paulmooring/4119387 to your computer and use it in GitHub Desktop.
Reset password via script on ubuntu
This file contains hidden or 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
Tue Nov 20, 10:21 AM - git branch: - rbenv version: 1.9.3-p194 | |
paul@paul-linux ~ $ cat test.sh | |
password="mypassword" | |
user="test" | |
echo -e "${password}\n${password}" | sudo passwd $user | |
Tue Nov 20, 10:21 AM - git branch: - rbenv version: 1.9.3-p194 | |
paul@paul-linux ~ $ sshpass -p 'mypassword' ssh [email protected] "whoami" | |
Received disconnect from 127.0.0.1: 2: Too many authentication failures for test | |
Tue Nov 20, 10:21 AM - git branch: - rbenv version: 1.9.3-p194 | |
paul@paul-linux ~ $ ./test.sh | |
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully | |
Tue Nov 20, 10:21 AM - git branch: - rbenv version: 1.9.3-p194 | |
paul@paul-linux ~ $ sshpass -p 'mypassword' ssh [email protected] "whoami" | |
test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment