Created
January 19, 2017 13:56
-
-
Save etaf/2f53e4fe34eb19266ef52477f41a92e1 to your computer and use it in GitHub Desktop.
auto_passwd
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 | |
set timeout 20 | |
set cmd [lrange $argv 1 end] | |
set password [lindex $argv 0] | |
eval spawn $cmd | |
expect "assword:" | |
send "$password\r"; | |
interact | |
Put it to /usr/bin/exp, then you can use: | |
exp <password> ssh <anything> | |
exp <password> scp <anysrc> <anydst> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment