I'm trying to write an app that will change my password on several
Solaris systems.  The application is based on the Shell example.  I
provide an implementation of InputStream that feeds a simple sequence
to change the password.  ex. "passwd\noldpwd\nnewpwd\nnewpwd\n".


The program appears to feed all of the input into the connection
before the system issues the first prompt.  The Solaris system appears
to detect the 'passwd' command, but then seems to flush any input and
issues a new read.  Consequently the responses provided by the script
are never seen.

Based on my guess that passwd is flushing the input stream and
prompting for input, I need to figure out how to synchronize the
feeding of input from my implementation of InputStream with the output
that is being generated by the server.

Note that the program works perfectly fine if I use System.in because
I am able to manually pace the delivery of input from the keyboard.
The problem is how to watch the output from Solaris and throttle the
input stream.

Any pointers to existing examples, or specific advice will be appreciated.

Thanks
Michael

------------------------------------------------------------------------------

_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to