Skip to content

Instantly share code, notes, and snippets.

@d4rk8l1tz
Forked from hasanen/ssh.expect
Last active August 29, 2015 14:06
Show Gist options
  • Save d4rk8l1tz/debbb65a552a7baa546e to your computer and use it in GitHub Desktop.
Save d4rk8l1tz/debbb65a552a7baa546e to your computer and use it in GitHub Desktop.
#!/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