Last active
December 16, 2015 16:59
-
-
Save horitaku1124/5467062 to your computer and use it in GitHub Desktop.
$ ./chpasswd user newpassword
でuserのパスワードを変更
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
#!/bin/bash | |
expect -c " | |
set timeout 10 | |
spawn passwd $1 | |
expect \"新しいパスワード:\" { | |
send \"$2\n\" | |
expect \"新しいパスワードを再入力してください:\" | |
send \"$2\n\" | |
} \"New password:\" { | |
send \"$2\n\" | |
expect \"Retype new password:\" | |
send \"$2\n\" | |
} | |
{interact} | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment