linux - Expect never matches the pattern -


i trying write script enter password automatically, seems expect never matches pattern.

#!/usr/bin/expect --  set pass "test" set timeout 5  spawn sudo ssh -i ~/.ssh/id_rsa stricthostkeychecking=no vongrad@localhost  expect {   timeout { send_user "\nfailed password prompt\n"; exit 1 }   "*ssword*" {     send "$pass\r"   } } 

do have suggestions?

how using key (without password) logging in instead of password write in script? way avoid being promped passwords ssh. example described here: http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -