"John Call" <> wrote in message news:<>...
> I need to write some code on a Win32 box that will connect securely to a
> linux box, su (which is interactive), and then run a command line program
> which will prompt me for some input (interactive). I planned to ssh to the
> box and use Expect to handle the interactive issues. I have found that
> Expect is not an option on Win32.
>
> I am only vaguely familiar with Win32 and am not sure what my options are
> for connecting securely to linux box and running interactive programs on the
> linux box. My own research has turned up very little. If anyone has any
> ideas on this I would appreciate it.
>
>
This is a command line login, or a GUI login?
Look at Net::Telnet and the waitfor function. If it needs to be ssh,
there may be a way to run a similar script through that (anybody
know?). Regular telnet will pass passwords in plaintext by default.
In general, it would be something like:
$t = new Net::Telnet (Port => $portnum, Timeout => 20);
$t->open('myserver');
$t->waitfor('/login: $/');
$t->print('administrator');
$t->waitfor('/password: $/');
$t->print('my-passwd');
|