in reply to Net::SSH::Perl script in windows - getpwuid is unimplemented

If you are on Windows, then you'll need to use Net::SSH::W32Perl. Try this instead:
#!/usr/bin/perl use strict; use warnings; use Net::SSH::W32Perl; my $host = 'localhost'; my $user = 'user'; my $pass = 'password'; my $cmd = 'perldoc -f getpwuid'; my $ssh = Net::SSH::W32Perl->new( $host, debug => 1, protocol => 2 ); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout, "\n"; exit;

Replies are listed 'Best First'.
Re^2: Net::SSH::Perl script in windows - getpwuid is unimplemented
by sthirumalai (Novice) on Feb 24, 2010 at 17:52 UTC
    Hi, I tried this W32perl module also. This is also giving the same error. The getpwuid function is unimplemented at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 39, <GEN0> line 1. Thanks, Thiru
      You didn't use Net::SSH::Win32Perl. Look a little closer at the error. The getpwuid function isn't implemented. That means don't try to run getpwuid. Try $ENV{USERNAME} instead.
        is that required to use in cygwin environment. also im not calling getpwuid function. here is my code
        use strict; use warnings; use Net::SSH::W32Perl; my $host = 'host'; my $pass = 'pwd'; my $user = 'userid'; my $cmd = 'command'; my $ssh = new Net::SSH::W32Perl( $host, debug => 1, protocol => 2 ); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout, "\n";
        I am running this script in windows activestate perl environment. the script trace is
        Reading configuration data /.ssh/config Reading configuration data /etc/ssh_config Connecting to <hostname>, port 22. Socket created, turning on blocking... Remote protocol version 2.0, remote software version OpenSSH_5.2 Net::SSH::Perl Version 1.34, protocol version 2.0. The getpwuid function is unimplemented at C:/Perl/site/lib/Net/SSH/Per +l/SSH2.pm line 39, <GEN0> line 1.
Re^2: Net::SSH::Perl script in windows - getpwuid is unimplemented
by Anonymous Monk on Aug 19, 2015 at 07:33 UTC
    Hello I am getting error while running window.
    Math::Pari not locatable. C:\Users\a-mrayappa\Desktop>test.pl CHE3-W01145: Reading configuration data /.ssh/config CHE3-W01145: Reading configuration data /etc/ssh_config CHE3-W01145: Connecting to apm, port 22. CHE3-W01145: Socket created, turning on blocking... CHE3-W01145: Remote version string: SSH-2.0-OpenSSH_4.3 CHE3-W01145: Remote protocol version 2.0, remote software version Open +SSH_4.3 Can't locate loadable object for module Math::Pari in @INC (@INC conta +ins: C:/Pe rl64/site/lib C:/Perl64/lib .) at C:/Perl64/lib/Net/SSH/Perl/Util/SSH2 +MP.pm line 6. Compilation failed in require at C:/Perl64/lib/Net/SSH/Perl/Util/SSH2M +P.pm line 6. BEGIN failed--compilation aborted at C:/Perl64/lib/Net/SSH/Perl/Util/S +SH2MP.pm l ine 6. Compilation failed in require at C:/Perl64/lib/Net/SSH/Perl/Util.pm li +ne 56. BEGIN failed--compilation aborted at C:/Perl64/lib/Net/SSH/Perl/Kex/DH +1.pm line 10. Compilation failed in require at C:/Perl64/lib/Net/SSH/Perl/Kex.pm lin +e 6. BEGIN failed--compilation aborted at C:/Perl64/lib/Net/SSH/Perl/Kex.pm + line 6. Compilation failed in require at C:/Perl64/lib/Net/SSH/Perl/SSH2.pm li +ne 6. BEGIN failed--compilation aborted at C:/Perl64/lib/Net/SSH/Perl/SSH2.p +m line 6.

    Code tags added by GrandFather

      Install Math::Pari?

      Anyway, nowadays you should probably be using Net::SSH2. If you are using Strawberry Perl, it is already included. Check also Net::SSH::Any.