Mail Archives: cygwin/2001/06/14/15:45:07
-----Original Message-----
From: Andrew Markebo [mailto:flognat AT flognat DOT myip DOT org]
Sent: Thursday, June 14, 2001 2:48 PM
Could it be that ssh doesn't use stdin or something for reading the
password..
An alternative way, of not needing to enter the password is to add
your public key to the authorized_keys and/or authorized_keys2 files on
the receiving host.
SHUBA : INFACT I TRIED THE SAME PROCESS WITH AN EMPTY PASSPHRASE (ie, Expect
script without the 'expect' and 'send' statements), AND IT WORKS !!! BUT MY
TEAM LEAD DOES NOT WANT IT TO WORK WITH AN EMPTY PASSPHRASE..
BTW What happens when you do 'ssh -v -l username -p 1010 hostname "ls -l"'
in the expect script?
Here's the output:
$ ./connect_ws
spawn ssh -v -l ssimha -p 2022 webstats.merck.com ls
OpenSSH_2.5.2p2, SSH protocols 1.5/2.0, OpenSSL 0x0090600f
debug1: Seeding random number generator
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug1: ssh_connect: getuid 500 geteuid 500 anon 1
debug1: Connecting to webstats.merck.com [54.23.204.113] port 2022.
debug1: Connection established.
debug1: identity file /home/admin/.ssh/identity type 0
debug1: unknown identity file /home/admin/.ssh/id_rsa
debug1: identity file /home/admin/.ssh/id_rsa type -1
debug1: unknown identity file /home/admin/.ssh/id_dsa
debug1: identity file /home/admin/.ssh/id_dsa type -1
debug1: Remote protocol version 1.5, remote software version 1.2.27
debug1: no match: 1.2.27
debug1: Local version string SSH-1.5-OpenSSH_2.5.2p2
debug1: Waiting for server public key.
debug1: Received server public key (768 bits) and host key (1024 bits).
debug1: Host 'webstats.merck.com' is known and matches the RSA1 host key.
debug1: Found key in /home/admin/.ssh/known_hosts:1
debug1: Encryption type: 3des
debug1: Sent encrypted session key.
debug1: Installing crc compensation attack detector.
debug1: Received encrypted confirmation.
debug1: Trying RSA authentication with key 'admin AT WS007594'
debug1: Received RSA challenge from server.
Enter passphrase for RSA key 'admin AT WS007594': shuba
<no putput>
admin AT WS007594 ~/scripts
Sometimes, it generates the foll. output. Observe the last few lines where
it writes junk when the program is expecting my passphrase!!
admin AT WS007594 ~/scripts
$ spawn ssh -v -l ssimha -p 2022 webstats.merck.com ls
OpenSSH_2.5.2p2, SSH protocols 1.5/2.0, OpenSSL 0x0090600f
debug1: Seeding random number generator
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug1: ssh_connect: getuid 500 geteuid 500 anon 1
debug1: Connecting to webstats.merck.com [54.23.204.113] port 2022.
debug1: Connection established.
debug1: identity file /home/admin/.ssh/identity type 0
debug1: unknown identity file /home/admin/.ssh/id_rsa
debug1: identity file /home/admin/.ssh/id_rsa type -1
debug1: unknown identity file /home/admin/.ssh/id_dsa
debug1: identity file /home/admin/.ssh/id_dsa type -1
debug1: Remote protocol version 1.5, remote software version 1.2.27
debug1: no match: 1.2.27
debug1: Local version string SSH-1.5-OpenSSH_2.5.2p2
debug1: Waiting for server public key.
debug1: Received server public key (768 bits) and host key (1024 bits).
debug1: Host 'webstats.merck.com' is known and matches the RSA1 host key.
debug1: Found key in /home/admin/.ssh/known_hosts:1
debug1: Encryption type: 3des
debug1: Sent encrypted session key.
debug1: Installing crc compensation attack detector.
debug1: Received encrypted confirmation.
debug1: Trying RSA authentication with key 'admin AT WS007594'
Enter passphrase for RSA key 'admin AT WS007594': debug1: Received RSA
challenge from server.
shuba
<no output>
admin AT WS007594 ~/scripts
-----Original Message-----
| From: Simha, Shuba
| Sent: Thursday, May 31, 2001 11:37 AM
| The very same does not work for me !!! Here's the output from my session..
|
| admin AT WS007594 ~/scripts
| $ cat connect_ws
| #!/usr/bin/expect -f
| spawn /bin/ssh -l username -p 1010 hostname "ls -l"
| expect -re "Enter passphrase for RSA key '.*': "
| send "shuba\r"
| expect eof
|
|
| admin AT WS007594 ~/scripts
| $ ./connect_ws
| spawn /bin/ssh -l username -p 1010 hostname ls -l
| Enter passphrase for RSA key 'admin AT WS007594': shuba
|
| <Comments> No output !!
|
|
| admin AT WS007594 ~/scripts
| $ callconn.pl connect_ws ftp-rfc shellscript try
| cfile.c connect_ws~ perlfile.pl shellscript1
|
| <Comments> I typed ls - not echoed
|
| admin AT WS007594 ~/scripts
| $ This is not seen
|
| <Comments> I typed echo This is not seen - The command is invisible !!
|
| admin AT WS007594 ~/scripts
| $
|
|
| -----Original Message-----
| From: Mark Paulus [mailto:commpg AT yahoo DOT com]
| Sent: Thursday, May 31, 2001 10:36 AM
| To: cygwin AT cygwin DOT com
| Subject: Re: Calling SSH from Expect - URGENT
|
|
| I believe this is a problem with the way tty's are handled under cygwin.
| I tried this script on a friend's debian box, and it also works as
expected.
|
| I think what's going on here is that somehow the ssh's stdin is getting
| "disconnected" from the expect terminal (I don't know whether the
| problem is expect's or ssh's though). This is evidenced by the fact that
| you are seeing the password that expect is typing. Expect is typing
| the password into a standard stream, no a password enabled, character
| hiding stream such as ssh would be using. I have enclosed the output
| from my test session from debian, and you can see that there is no
| password.
|
| mpaulus AT csu6223286:~
| $ ./doit
| spawn /usr/bin/ssh -l mgpaulus 24.221.196.205 ls -l
| mgpaulus AT 24 DOT 221 DOT 196 DOT 205's password:
| total 1356
| drwxr-sr-x 2 mgpaulus mgpaulus 4096 Mar 12 23:35 News
| drwxr-sr-x 2 mgpaulus mgpaulus 4096 Mar 8 23:13 bin
| drwxr-sr-x 8 mgpaulus mgpaulus 4096 Mar 30 13:17 fetchmail-5.3.3
|
| mpaulus AT csu6223286:~
| $ cat doit
| #!/usr/bin/expect -f
| spawn /usr/bin/ssh -l userid host "ls -l"
| expect -re "word:"
| send "password\r"
| expect eof
|
| mpaulus AT csu6223286:~
| $
|
| On Wed, 30 May 2001 14:22:29 -0400, Simha, Shuba wrote:
|
| >Hi Cygwin users,
| >
| >I am using Expect-5.26 from Cygwin-(not sure of the version)
| >I am trying to connect to a remote host through SSH, & on the command
line,
| >it works just perfect. But when I write an "Expect" script for the same,
it
| >does not do anything.
| >
| >Here is the comand I use:
| > /bin/ssh -l username -p port hostname.abc.com "ls -l"
| >It prompts for the passphrase, & when I enter it, it neatly lists the
| >contents of my home dir. (username, port & hostname.abc.com actually have
| >real values)
| >
| >The Expect code fragment is below:
| >
| >#!/usr/bin/expect
| >spawn /bin/ssh -l username -p port hostname.abc.com "ls -l"
| >expect -re "Enter passphrase for RSA key '.*': "
| >send "passphrase\r"
| >expect eof
| >
| >This however does not list anything, though it takes the passphrase.. (I
| can
| >see the passphrase being echoed on the screen)
| >More surprisingly, as soon as the script ends, the monitor will go out of
| >echo mode(I cannot see what I type!!)
| >
| >The same happens when I try SCP as well.
| >
| >Can anybody tell me whats wrong with what I am doing?
| >
| >Thanks a lot on advance..
| >-Shuba
|
| --
| Want to unsubscribe from this list?
| Check out: http://cygwin.com/ml/#unsubscribe-simple
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -