spawn_id: spawn id exp6 not open spawn_id: spawn id exp6 not open linux linux

spawn_id: spawn id exp6 not open


I suspect the expect is not able to find out(matching) the pattern you are sending.

expect "password:" {send "mypassword\r"}expect "Continue to run (y/n)" {send "n\r"}

Check out again whether the "password:" and "Continue to run (y/n)" are in correct CAPS.

If still getting the same error, you can try using regular expression.


Try to do a normal ssh without script. See if it works. Sometimes the remote host identification changes, and the host has a new ip or new key. Then it helps to remove the old key with ssh-keygen -f ~/.ssh/known_hosts -R old_host, or something similar.


I had this problem and it was down to using the wrong port.