Created
February 14, 2012 18:15
-
-
Save gnufs/1828748 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 | |
spawn ssh gnufs@nsa.gov | |
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