rudeb0y has asked for the wisdom of the Perl Monks concerning the following question:

Anybody have insight into where I can find some nuggets on either tunneling through putty
(or some other method) to be able to access my *nix servers from win2k...using perl.

Thanks o gracious ones.!!

Replies are listed 'Best First'.
Re: Perl and Putty
by sh1tn (Priest) on Mar 21, 2006 at 14:07 UTC
    You mean ssh network protocol.
    use Net::SFTP; use Net::SSH::Perl; # sample usage: my $ssh_obj = Net::SSH::Perl->new($host); my $scp_obj = Net::SFTP->new($host, { user => $username, password => $password, } ); $ssh_obj->login($username, $password); $scp_obj->put($local_filename, $remote_filename); my($stdout, $stderr, $exit) = $ssh_obj->cmd($program_to_be_executed);


Re: Perl and Putty
by salva (Canon) on Mar 21, 2006 at 14:21 UTC
    PuTTY is an interactive application not intended to be used from other programs.

    Your best options are:

    • Net::SSH::Perl: implements an SSH client in Perl. It depends on a bunch of other modules and is not easy to install.
    • Net::SSH2: another Perl SSH client but based on a C library.
    • cygwin version of the OpenSSH ssh client. You can use Net::SSH on top of it or just open it through IPC::Open2 and send commands to it and read the output back (though, you should be careful to not block). If you just want to transfer files, you can also use my Net::SFTP::Foreign package with it.
Re: Perl and Putty
by InfiniteSilence (Curate) on Mar 21, 2006 at 15:44 UTC
    If you read the putty docs you will see there is a command line companion tool to putty called plink.exe. Plink is intended to be used on the command line.

    Celebrate Intellectual Diversity