Created
February 14, 2012 18:51
-
-
Save gnufs/1829070 to your computer and use it in GitHub Desktop.
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 | |
# Login to SSH with password automatically | |
# Requires expect: | |
# sudo apt-get install expect | |
set timeout 60 | |
set login $argv | |
spawn ssh $login | |
while {1} { | |
expect { | |
eof {break} | |
"The authenticity of host" {send "yes\r"} | |
"password:" {send "p4ssw0rd\r"} | |
"*\]" {send "exit\r"} | |
} | |
} | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment