Created
May 4, 2013 14:01
-
-
Save young001/5517595 to your computer and use it in GitHub Desktop.
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 -f | |
# ./ssh.exp password 192.168.1.11 id | |
set name [lrange $argv 2 2] | |
set server [lrange $argv 1 1] | |
set pass [lrange $argv 0 0] | |
spawn ssh $name@$server | |
match_max 100000 | |
expect "*?assword:*" | |
send -- "$pass\r" | |
send -- "\r" | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment