Last active
August 29, 2015 14:03
-
-
Save SpekkoRice/aa705fceab588a23eee8 to your computer and use it in GitHub Desktop.
Expect Script to log into SSH
This file contains hidden or 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 -f | |
# Please remember to make the file executable using: | |
# chmod +x expectSSH.exp | |
# | |
# To run the Script simply use ./expectSSH.sh yourhost.com root password | |
set host [lindex $argv 0] | |
set user [lindex $argv 1] | |
set pass [lindex $argv 2] | |
spawn ssh $user@$host | |
expect "assword:" | |
send "$pass\r" | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple, yet POWERFUL!