Operating System - HP-UX
1752610 Members
4280 Online
108788 Solutions
New Discussion юеВ

Re: ssh issue w/ "expect"?

 
OldSchool
Honored Contributor

ssh issue w/ "expect"?

So...I'm running the following versions ssh/ssl on HP-11.0 and AIX 4.3.3, 5.2 and 5.2:
OpenSSH_4.3p2, OpenSSL 0.9.7l 28 Sep 2006

I've observed the following behaviour when running expect's autopasswd:

the password change is processed, but at the completion it does not return control to the terminal (i.e. terminal / keyboard frozen).

Similar experience with PowerBroker's pbreplay keystroke log player.

This occurs on all of the OSes noted above.

In testing, I note that in all cases, log in via telnet and both of the above function properly across all the noted OSes. This leads me to suspect issues w/ ssh and exec's, or possibly redirection.

Anybody have similar experience and/or know for sure if a newer OpenSSH will fix this issue? I'd like some confirmation before I start rebuilding everything from source for the HP-UX (and AIX 4.3.3) boxes.
9 REPLIES 9
Fred Ruffet
Honored Contributor

Re: ssh issue w/ "expect"?

Have you tried ending your connexion with ssh escape code ~. ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Tingli
Esteemed Contributor

Re: ssh issue w/ "expect"?

Or send in "\r\n" after the password.
OldSchool
Honored Contributor

Re: ssh issue w/ "expect"?

Your missing the point (i think) that both the "pbreplay" and "expect" hang the terminal when logged in via ssh, but not when connected via telnet.

I'd figure the behaviour should be identical under both???
OldSchool
Honored Contributor

Re: ssh issue w/ "expect"?

ie. i log in via ssh and at the command line run:

> autopasswd lxxs7m dunce999
spawn passwd lxxs7m
Changing password for "l00s7m"
lxxs7m's New password:
Enter the new password again:


keyboard is dead, so I can't enter the ssh escape.

I just want to know:
a) has anyone else observed this and
b) if so, did installing a new version of ssh fix it?
OldSchool
Honored Contributor

Re: ssh issue w/ "expect"?

anybody else care to chime in??
Laurent Menase
Honored Contributor

Re: ssh issue w/ "expect"?

I think ssh read passwd on /dev/tty, which is a pseudo device which attach to the control tty of the session
telnet read passwd on stdin

why?
ssh can be piped to send data, so it needs to read from the tty and not from stdin - some other application read on stderr


expect uses only stdin of the spawned process
and can't be attached to /dev/tty.

OldSchool
Honored Contributor

Re: ssh issue w/ "expect"?

so...got some info,

but given that nobody has answered the questions posed...i suppose i'll have to try a newer version and see what happens
Laurent Menase
Honored Contributor

Re: ssh issue w/ "expect"?

you may try
expect expect ssh ....

or
expect rlogin localhost

and then in the script call the ssh command

rlogin can be replaced by any other command which had a client side only using stdin& stdout
OldSchool
Honored Contributor

Re: ssh issue w/ "expect"?

everybody seems to be missing the point...

i've given up on this for now....

the questions (unanswered) were:

1) has anybody observed....
2) does a newer release....

the entire point was that i logged in via putty and entered either expect's autopasswd or PowerBroker's log replay command and they hang.

I'm not rlogging in...or running a separate command over ssh....and of the above work simply fine over telnet. they also work on a RedHatEL4.0 box running even older versions of openssh / openssl.