Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 14 Oct 2003 10:49:14 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Problems with cygwin, "expect" and ssh Message-ID: <20031014084914.GS14344@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <0A06595FB065D411BC6800508BE32AE417935EF1 AT USPLM212 DOT txpln DOT us DOT eds DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0A06595FB065D411BC6800508BE32AE417935EF1@USPLM212.txpln.us.eds.com> User-Agent: Mutt/1.4.1i 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/