Created
September 12, 2014 08:23
-
-
Save hasanen/679e15846f2fa4404ba5 to your computer and use it in GitHub Desktop.
Expect-script for automating ssh-logins without keys
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 | |
set username [lrange $argv 0 0] | |
set host [lrange $argv 1 1] | |
set password [lrange $argv 2 2] | |
set timeout -1 | |
spawn ssh $username@$host | |
expect "*?assword:*" | |
send -- "$password\r" | |
send -- "\r" | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment