Skip to content

Instantly share code, notes, and snippets.

@beanyoung
Last active December 29, 2017 02:24
Show Gist options
  • Save beanyoung/8f690fd3f6b51432386539c1c2556124 to your computer and use it in GitHub Desktop.
Save beanyoung/8f690fd3f6b51432386539c1c2556124 to your computer and use it in GitHub Desktop.
#!/usr/bin/expect -f
set host [lindex $argv 0]
spawn ssh demo.com
send "su ubuntu\r"
expect "?assword"
send "password\r"
interact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment