| # ssh using the parms provided by the caller. The benefit provided by this |
| # program is that it will enter the password for you (i.e. non-interactively). |
| # Description of arguments: |
| # Arg1: The ssh parm string. This is the totality of ssh parms you wish to |
| # specify (e.g. userid, host, etc.). |
| ############################################################################### |
| set password [lindex $argv 0] |
| set ssh_parms [lreplace $argv 0 0] |
| eval spawn ssh ${ssh_parms} |
| -re "Are you sure you want to continue connecting" { |
| if { $attempts > $max_attempts } { |
| puts stderr "**ERROR** Exceeded $max_attempts attempts to ssh." |
| puts stderr "**ERROR** Timed out waiting for password prompt." |
| puts stderr "**ERROR** End of data waiting for password prompt." |
| "Permission denied, please try again." { |
| puts "**ERROR** Incorrect userid or password provided to this program." |
| # We don't ever expect to see this string. This will keep this program |
| "When in the course of human events, it becomes :" {send "whatever\r"} |
| ############################################################################### |