Created
July 13, 2014 07:23
-
-
Save nachivpn/3c41b1556075e0eb5885 to your computer and use it in GitHub Desktop.
Script to automate ssh connections (for mac as brew won't let you install sshpass -.-)
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 | |
# | |
#credits: http://casual-effects.blogspot.in/2013/05/ssh-with-command-line-password-on-os-x.html | |
set host "host" | |
set password "password" | |
spawn ssh $host | |
expect { | |
"(yes/no)?" { | |
send -- "yes\r" | |
exp_continue | |
} | |
"*password:*" { | |
send -- "$password\r" | |
} | |
} | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment