Mail Archives: cygwin/2003/10/14/04:49:25
On Mon, Oct 13, 2003 at 06:47:12PM -0500, Greenup, Greenup wrote:
> Enter "expect", which ships with a little script for changing your
> password (even on multiple systems en-mass). Nice. Except... it doesn't
> seem to work with ssh... Near as I can tell from my googling, a problem of
> openssh reading the tty directly, rather than allocating a tty. True?
> False? What about other things?; messing with the CYGWIN variable, adding
> "tty" in there was not helpful, nor was adding "-t" to ssh. Any other
> ideas? I don't want to use telnet... "console telnet" is nice, and will get
> the job done, but it's not a secure answer.
I'm not sure what you did wrong but apparently you did. I just tried
the following crude script:
========= SNIP =========
#!/usr/bin/expect -f
set timeout 10
spawn ssh mycygwinbox
expect {
"myusername AT mycygwinbox's password: " { }
default {
send_user "Spawning failed\n"
exit
}
}
send "mypassword\n"
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
}
}
========= SNAP =========
and it worked perfectly fine, from a Windows console window as well as from
a ssh session itself. The first two regexps are expecting my prompt, btw.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
--
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/
- Raw text -