Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication?
Brought to you by:
dbrobins
From: Anthony L. <ant...@ya...> - 2012-02-13 14:50:55
|
Thanks for spotting that typo, but fixing that typo does not fix the problem. The exactly same problem remains: Invalid option 'key_path' or bad combination of options at ./test.pl line 14 I have this version: Net-SFTP-Foreign-1.69 from http://search.cpan.org/~salva/Net-SFTP-Foreign-1.69/lib/Net/SFTP/Foreign.pm And my perl is Strawberry Perl 5, version 12. I am not sure why the documentation doesn't say what combinations are accepted and what are not. I think my combination makes sense: I do need to specify the port number, I do need to specify the private key file path, I do need to specify the user name, I do need to specify the ssh command. ________________________________ From: Salvador Fandino <sfa...@ya...> To: Anthony Liu <ant...@ya...> Sent: Monday, February 13, 2012 4:21 AM Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? >________________________________ > From: Anthony Liu <ant...@ya...> >To: Russ Brewer <us...@gm...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Friday, February 10, 2012 8:48 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >Does anyone out there have a minimum working example using Net::SFTP::Foreign with plink.exe? I tried this: > > >use Net::SFTP::Foreign; > >$host = "my.ssh.server.com"; >$port = 22; >$user = "aliu"; >$publickey="id_dsa.pub"; >$privatekey = "id_dsa"; >$sshcmd = "plink.exe"; > >%args = ("port", $port, "key_path", $privatekey, "user", $user, "ssh_cmd", $sshcmd); > >my $sftp = Net::SFTP::Foreign->new(host=>@host, %args); > >if ($sftp->error) >{ > my ( $code, $error_name, $error_message ) = $sftp->error; > print "sftp error[$code] $error_name: $error_message \n"; >} >else >{ > print "Success!"; >} > >But I get an error saying: Invalid option 'key_path' or bad combination of options at ./test.pl line 14 You are defining $host but passing @host. Activate warnings and strict on you programs. Which version of Net::SFTP::Foreign have you installed. To known, run the following command: perl -MNet::SFTP::Foreign -e 'print qq($Net::SFTP::Foreign::VERSION\n)' |