Skip to content

Instantly share code, notes, and snippets.

@gnufs
Created February 14, 2012 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnufs/1828748 to your computer and use it in GitHub Desktop.
Save gnufs/1828748 to your computer and use it in GitHub Desktop.
#!/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