in reply to Re^2: Having trouble installing Module on Strawberry Perl
in thread Having trouble installing Module on Strawberry Perl

Net::SSH::Perl and SSH or OpenSSH, or maybe just log in as the target user directly:

open my $remote, '| ssh otheruser@remotehost' or die "Couldn't connect: $!"; print {$remote} "echo Test\n";

But that way, you don't get much interactivity and this only works if you have passwordless keys set up or store the key in pageant or another ssh keyring.

Replies are listed 'Best First'.
Re^4: Having trouble installing Module on Strawberry Perl
by taffer (Novice) on Jan 16, 2009 at 20:55 UTC
    I can't log in as the target user, since the target user is root, and root logins are disallowed on the remote machine. I also need a fair amount of interactivity. What I am trying to do is login, switch to root, kill the dhcp process, grab the leases file, parse it and pull out specific leases for processing, delete some of the leases, and finally restart the dhcp process.

      Probably not what you wanted to hear, but if all else fails, you could find a minimal Linux distro, install it in a vmware image (or some such), run it on your Windows box, and then do your work from that virtual machine ;)

      On Win32 I find Expect, IO-Tty and Net-SSH-Expect all build straight out of the box (and pass all tests) using Cygwin - but I haven't tested whether Net-SSH-Expect provides the mileage you need for the task at hand.

      Cheers,
      Rob