I have found some interesting behavior regarding the cygwin expect/ssh problem. I used the little expect script That Corinna created. It seemed to not see the prompt for the password from the spawned ssh, so it just timed out. But, when I redirect the stderr to /dev/null, it behaves correctly. Perhaps ssh is spitting some spurious bytes to stderr that are causing the expect pattern to not match:
------------------------------------------------------------------------ GOOD: [EMAIL PROTECTED] ~ $ ./sshtest 2>/dev/null spawn ssh -t 10.65.16.41 Before expect for assword: [EMAIL PROTECTED]'s password: Found assword: Before send of password After send of password Last login: Thu Jan 01 1970 00:00:00 from [======================================================================] Use of this system is explicitly limited to employees... ------------------------------------------------------------------------ ----- BAD: [EMAIL PROTECTED] ~ $ ./sshtest spawn ssh -t <hostname> Before expect for assword: [EMAIL PROTECTED]'s password: Spawning failed [EMAIL PROTECTED] ~ ------------------------------------------------------------------------ ------- SCRIPT: cat sshtest #!/usr/bin/expect -f set timeout 10 spawn ssh -t <hostname> puts "Before expect for assword:" expect { "*assword:" { puts "Found assword:" sleep 2 } default { send_user "Spawning failed\n" exit } } puts "Before send of password" send "xxxxxxx\r" puts "After send of password" expect { -re ".*\\$.* " { } default { send_user "Sending password failed\n" exit } } send "ls\n" expect { -re ".*\\$.* " { } default { send_user "Sending ls failed\n" exit } } send "exit\n" expect { -re ".*Connection to mycygwinbox closed.*" { } default { send_user "Sending exit failed\n" exit } } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/