ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 2)
Brought to you by:
dbrobins
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(4) |
Feb
(15) |
Mar
(13) |
Apr
(8) |
May
(5) |
Jun
(21) |
Jul
(4) |
Aug
(9) |
Sep
(11) |
Oct
(14) |
Nov
(15) |
Dec
(24) |
2005 |
Jan
(10) |
Feb
(20) |
Mar
(16) |
Apr
(10) |
May
(12) |
Jun
(16) |
Jul
(18) |
Aug
(21) |
Sep
(11) |
Oct
(19) |
Nov
(16) |
Dec
(9) |
2006 |
Jan
(17) |
Feb
(32) |
Mar
(60) |
Apr
(21) |
May
(24) |
Jun
(1) |
Jul
(6) |
Aug
(18) |
Sep
(4) |
Oct
(9) |
Nov
(31) |
Dec
(10) |
2007 |
Jan
(8) |
Feb
(11) |
Mar
(3) |
Apr
(7) |
May
(4) |
Jun
(6) |
Jul
(7) |
Aug
(3) |
Sep
(2) |
Oct
(5) |
Nov
(5) |
Dec
(5) |
2008 |
Jan
(12) |
Feb
(5) |
Mar
(7) |
Apr
(4) |
May
(37) |
Jun
(9) |
Jul
(24) |
Aug
(5) |
Sep
(2) |
Oct
(7) |
Nov
(6) |
Dec
(7) |
2009 |
Jan
(18) |
Feb
(9) |
Mar
(14) |
Apr
(14) |
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(6) |
Sep
(4) |
Oct
(12) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
(1) |
May
(4) |
Jun
|
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(2) |
Dec
(5) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(8) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(9) |
Dec
(7) |
2012 |
Jan
(1) |
Feb
(19) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(5) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
(6) |
Dec
|
2014 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: James P. <jam...@op...> - 2013-06-10 10:38:08
|
I have a script that connects to a server and checks if a list of rpms are installed. On some servers this hangs, on others it works fine. The problem seems to occur when the command being executed is longer than about 22000 characters. I've uploaded a simplified version of the script - that only does an echo - to pastebin: http://pastebin.com/NtFmkvZz I am running Net::SSH::Perl 1.34-9 on RHEL6.4 Next I'll bring out tcpdump next, and look at what is common between the failing servers, but I first wanted to ask if anyone had any suggestions or ideas? -- James Patterson jam...@op... -- http://www.fastmail.fm - IMAP accessible web-mail |
From: Calvin K. <ye...@gm...> - 2013-04-29 19:17:47
|
All, how can I use Net::SSH::Perl to test if the remote server allows ssh automatic login via $HOME/.ssh/authorized_keys? It will prompt for a password if not. But I'd like to just trap the event (suppress the prompt) since I only want to check if automatic is working. Thanks! Calvin |
From: Art A. <aix...@ya...> - 2013-03-14 11:57:54
|
http://www.ntdizajn.com/avlyzx/uaf.htm |
From: Colin W. <la...@gm...> - 2013-03-05 00:31:00
|
So this took me a while to figure out, and now that I have I'm not sure how to fix it. I've got an ssh server that's returning a window size of 0 in the SSH2_MSG_CHANNEL_OPEN_CONFIRMATION packet, and then following it up with a SSH2_MSG_CHANNEL_WINDOW_ADJUST. Since cmd attaches a handler to the confirmation, though, it tries to send the command before the remote window is big enough. I've got a couple of ideas of how to fix this, but I'm open to other suggestions: * Add some sort of message queue to the channel object, which will clear anything out when it gets a window adjust message. * Attach a new handler to window adjust to send the message out when that message is received. Neither seems like a great option, but I'm not sure I see any other ways. I'm willing to do the development work, I just need a little guidance from somebody who understands the design a little better than I do. Colin |
From: Hans de G. <ha...@da...> - 2012-03-29 06:31:29
|
Hi, I tried eval with {} and this time it actually worked. sub copy_file { my $source=shift; my $dest=shift; my $f; eval{$f=$sftp->get($source,$dest)}; if ($@) { print "Connection error!!\n"; #try to reconnect here.. } } Thanks a lot every one. On Wed, 28 Mar 2012 10:15:46 -0500 "Nigel Reed" <ni...@sy...> wrote: > I didn't CC the list in my reply to Hans. This will be useful to others > I'm sure. > > > ---------------------------- Original Message ---------------------------- > Subject: Re: [Ssh-sftp-perl-users] Trap connection errors somehow instead > of just letting the whole script die. > From: "Nigel Reed" <ni...@sy...> > Date: Wed, March 28, 2012 10:14 am > To: "Hans de Groot" <ha...@da...> > -------------------------------------------------------------------------- > > > Hans de Groot wrote: > > But some times during a session (lots of data) the script dies with: > > > > Connection failed: Connection reset by peer > > at /usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm line 568 > > > > But I need the script to keep running and detect these errors and try to > > reconnect and resume copyinf file. But it seems it's out of my hands? > > > I do something like this. > > eval { $ssh = Net::SSH::Perl->new($host, ( protocol => 2, > debug=>$debug )); }; > if ($@) { print "EREOR! Cannot connect to $host $@\n"; > noconnect($host); $pm->finish; next; } else { print "CONNECT > $host\n"; } > > Basically, wrap your command in an eval, then use $@ to determine if there > was a connection. > > -- > Nigel Reed > > > > > -- > Nigel Reed > > > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users -- Hans de Groot <ha...@da...> |
From: Hans de G. <ha...@da...> - 2012-03-29 06:14:32
|
Hello, What I tried before I posting here was this: sub copy_file { my $source=shift; my $dest=shift; my $f; eval($f=$sftp->get($source,$dest)); if ($@) { print "Connection error!!\n"; #try to reconnect here.. } } But what happened was that the script did not die, but also no error message or something. I mean it did not print the "connection error!!" message. It just sat there doing nothing. But maybe the eval should be betwen {} instead of () ? Could that explain the "waiting"? Thanks for your help. Hans On Wed, 28 Mar 2012 22:44:44 +1000 (EST) "Christian King" <chr...@ch...> wrote: > Wrap the relevant call(s) in an eval {} block. > > If there is a syntax error or runtime error, or a die statement is > executed, eval returns undef in scalar context or an empty list--or, for > syntax errors, a list containing a single undefined value--in list > context, and $@ is set to the error message. > > http://perldoc.perl.org/functions/eval.html > > The execution will drop out of the code within eval {} and back to your > program when there is an error. > > > Hello list, > > > > I made a sftp script that should copy stuff from a to b. > > > > But some times during a session (lots of data) the script dies with: > > > > Connection failed: Connection reset by peer > > at /usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm line 568 > > > > But I need the script to keep running and detect these errors and try to > > reconnect and resume copyinf file. But it seems it's out of my hands? > > > > The script dies in the net::sftp module. > > > > Are there any config settings I could pass to net:sftp or maybe net::ssh? > > > > It is rather irritating the way it works now. > > > > The only work arround I could think of now is have my script call an > > other script that copies the files and when it dies I can see it in the > > output. But tracking whichs files have been copied is a lot harder this > > way. > > > > Regards, > > > > > > -- > > Hans de Groot <ha...@da...> > > > > > > ------------------------------------------------------------------------------ > > This SF email is sponsosred by: > > Try Windows Azure free for 90 days Click Here > > http://p.sf.net/sfu/sfd2d-msazure > > _______________________________________________ > > Ssh-sftp-perl-users mailing list > > Ssh...@li... > > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > -- Hans de Groot <ha...@da...> |
From: Nigel R. <ni...@sy...> - 2012-03-28 15:42:39
|
I didn't CC the list in my reply to Hans. This will be useful to others I'm sure. ---------------------------- Original Message ---------------------------- Subject: Re: [Ssh-sftp-perl-users] Trap connection errors somehow instead of just letting the whole script die. From: "Nigel Reed" <ni...@sy...> Date: Wed, March 28, 2012 10:14 am To: "Hans de Groot" <ha...@da...> -------------------------------------------------------------------------- Hans de Groot wrote: > But some times during a session (lots of data) the script dies with: > > Connection failed: Connection reset by peer > at /usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm line 568 > > But I need the script to keep running and detect these errors and try to > reconnect and resume copyinf file. But it seems it's out of my hands? I do something like this. eval { $ssh = Net::SSH::Perl->new($host, ( protocol => 2, debug=>$debug )); }; if ($@) { print "EREOR! Cannot connect to $host $@\n"; noconnect($host); $pm->finish; next; } else { print "CONNECT $host\n"; } Basically, wrap your command in an eval, then use $@ to determine if there was a connection. -- Nigel Reed -- Nigel Reed |
From: Hans de G. <ha...@da...> - 2012-03-28 11:33:26
|
Hello list, I made a sftp script that should copy stuff from a to b. But some times during a session (lots of data) the script dies with: Connection failed: Connection reset by peer at /usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm line 568 But I need the script to keep running and detect these errors and try to reconnect and resume copyinf file. But it seems it's out of my hands? The script dies in the net::sftp module. Are there any config settings I could pass to net:sftp or maybe net::ssh? It is rather irritating the way it works now. The only work arround I could think of now is have my script call an other script that copies the files and when it dies I can see it in the output. But tracking whichs files have been copied is a lot harder this way. Regards, -- Hans de Groot <ha...@da...> |
From: Joseph W. <tel...@gm...> - 2012-02-21 22:44:45
|
Hello, I am having the hardest time building Net-SSH2-0.40 on Slackware 13.1 with a custom build of Perl, openssl, and libssh2. I have tried every imaginable combination. For example: bash-4.1$ which openssl /xtra/bin/openssl bash-4.1$ which perl /xtra/bin/perl bash-4.1$ ls /xtra/lib engines libssh2.a libssh2.so.1.0.1 libunbound.so pkgconfig libcrypto.a libssh2.la libssl.a libunbound.so.2 ssh2 libgd-static.a libssh2.so libunbound.a libunbound.so.2.11.0 libgd.so libssh2.so.1 libunbound.la perl5 bash-4.1$ pwd /home/surf/src/Net-SSH2-0.40 bash-4.1$ perl Makefile.PL lib=/xtra/lib inc=/xtra/include Subroutine checklibs redefined at inc/Module/Install/CheckLib.pm line 11. Subroutine assertlibs redefined at inc/Module/Install/CheckLib.pm line 25. Subroutine _author_side redefined at inc/Module/Install/CheckLib.pm line 39. The libssh2 library is required by this module. If you don't have it, you can download it from http://www.libssh2.org; you may also need OpenSSL, which can be obtained from http://www.openssl.org. Debian: sudo aptitude install libssh2-1-dev OpenSUSE: sudo zypper in libssh2-1 libssh2-devel You can pass your libssh2 lib and include dirs on the command line. E.g.: perl Makefile.PL lib=$HOME/libssh2/lib inc=$HOME/libssh2/include Can't link/include 'ssh2' -- Best Regards, [Joseph] Christian Werner Sr C 360.920.7183 H 757.304.0502 |
From: Steve P. <st...@fo...> - 2012-02-13 23:17:36
|
This is putty telling you that it doesn't know about this host as the host key isn't in puttys cache. You can add this by using putty manually to connect to the host and telling it to save the key in its cache. The reason the script fails is it (putty) is asking for an interactive response but, being a script there is no way to get this and so it exits. -- Steve. On 14/02/2012 5:58 AM, Anthony Liu wrote: > I wasn't aware this cpan utility, much like apt-get. So, I have > installed Net::SFTP::Foreign 1.69. Confirmed with your script: > > C:\PerlTests>perl ./fandino.pl > This is Net::SFTP::Foreign 1.69 running on perl v5.12.3 on MSWin32 > > Now, if I run the following code to try to connect to my ssh server: > > use Net::SFTP::Foreign 1.69; > > $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!"; > } > > I get this: > > C:\PerlTests>perl ./test.pl > The server's host key is not cached in the registry. You > have no guarantee that the server is the computer you > think it is. > The server's rsa2 key fingerprint is: > ssh-rsa 2048 3c:3c:ad:17:98:88:c5:1d:95:9e:1b:d6:4e:05:b0:a9 > If you trust this host, enter "y" to add the key to > PuTTY's cache and carry on connecting. > If you want to carry on connecting just once, without > adding the key to the cache, enter "n". > If you do not trust this host, press Return to abandon the > connection. > Store key in cache? (y/n) Connection abandoned. > sftp error[Connection to remote server is broken] : > > C:\PerlTests> > > > > > > > > > ------------------------------------------------------------------------ > *From:* Salvador Fandino <sfa...@ya...> > *To:* Anthony Liu <ant...@ya...> > *Sent:* Monday, February 13, 2012 1:25 PM > *Subject:* Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key > for authentication? > > >________________________________ > > > From: Anthony Liu <ant...@ya... > <mailto:ant...@ya...>> > >To: Salvador Fandino <sfa...@ya... <mailto:sfa...@ya...>> > >Cc: "Ssh...@li... > <mailto:Ssh...@li...>" > <Ssh...@li... > <mailto:Ssh...@li...>> > >Sent: Monday, February 13, 2012 7:03 PM > >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key > for authentication? > > > > > >OK, let's do this step by step. I have renamed Foreign.pm > <http://Foreign.pm> to Foreign.old.pm <http://Foreign.old.pm>. And > naturally, if I issue > > > > > >perldoc Net::SFTP::Foreign > > > > > >I get this: > > > > > >No documentation found for "Net::SFTP::Foreign". > > > > > >I guess I will need to specify the PERLLIB path. > > > Just run > > cpan Net::SFTP::Foreign > > To download and install the latest version of the module from CPAN. > > > If that doesn't work (for instance, if the machine is not connected to > the internet), In order to keep you going, just copy the Foreign.pm file > and Foreign directory from the Net-SFTP-Foreign-1.69.tar.gz distribution > to the same place where you found the old ones, and try your script again. > > > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > > > > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Anthony L. <ant...@ya...> - 2012-02-13 18:59:40
|
I wasn't aware this cpan utility, much like apt-get. So, I have installed Net::SFTP::Foreign 1.69. Confirmed with your script: C:\PerlTests>perl ./fandino.pl This is Net::SFTP::Foreign 1.69 running on perl v5.12.3 on MSWin32 Now, if I run the following code to try to connect to my ssh server: use Net::SFTP::Foreign 1.69; $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!"; } I get this: C:\PerlTests>perl ./test.pl The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 2048 3c:3c:ad:17:98:88:c5:1d:95:9e:1b:d6:4e:05:b0:a9 If you trust this host, enter "y" to add the key to PuTTY's cache and carry on connecting. If you want to carry on connecting just once, without adding the key to the cache, enter "n". If you do not trust this host, press Return to abandon the connection. Store key in cache? (y/n) Connection abandoned. sftp error[Connection to remote server is broken] : C:\PerlTests> ________________________________ From: Salvador Fandino <sfa...@ya...> To: Anthony Liu <ant...@ya...> Sent: Monday, February 13, 2012 1:25 PM Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? >________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 7:03 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >OK, let's do this step by step. I have renamed Foreign.pm to Foreign.old.pm. And naturally, if I issue > > >perldoc Net::SFTP::Foreign > > >I get this: > > >No documentation found for "Net::SFTP::Foreign". > > >I guess I will need to specify the PERLLIB path. Just run cpan Net::SFTP::Foreign To download and install the latest version of the module from CPAN. If that doesn't work (for instance, if the machine is not connected to the internet), In order to keep you going, just copy the Foreign.pm file and Foreign directory from the Net-SFTP-Foreign-1.69.tar.gz distribution to the same place where you found the old ones, and try your script again. |
From: Anthony L. <ant...@ya...> - 2012-02-13 18:04:09
|
OK, let's do this step by step. I have renamed Foreign.pm to Foreign.old.pm. And naturally, if I issue perldoc Net::SFTP::Foreign I get this: No documentation found for "Net::SFTP::Foreign". I guess I will need to specify the PERLLIB path. ________________________________ From: Salvador Fandino <sfa...@ya...> To: Anthony Liu <ant...@ya...> Cc: "Ssh...@li..." <Ssh...@li...> Sent: Monday, February 13, 2012 11:51 AM Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? >________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 5:44 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >Problem is: I don't even know where the so-called old files/versions of Net::SFTP::Foreign on my Win7 box. I am new to Perl. I am not new to programming. There must be some perl commands that will uninstall the specified version of a module. I don't think there is any command to uninstall modules on Strawsberry Perl. The location of the old files can be found with the following perl code: use Net::SFTP::Foreign; print Dumper "$INC{'Net/SFTP/Foreign.pm'}\n"; Or just use your preferred OS search facility to find files and directories named "Foreign.pm" and "Foreign" respectively. |
From: Salvador F. <sfa...@ya...> - 2012-02-13 16:51:43
|
>________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 5:44 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >Problem is: I don't even know where the so-called old files/versions of Net::SFTP::Foreign on my Win7 box. I am new to Perl. I am not new to programming. There must be some perl commands that will uninstall the specified version of a module. I don't think there is any command to uninstall modules on Strawsberry Perl. The location of the old files can be found with the following perl code: use Net::SFTP::Foreign; print Dumper "$INC{'Net/SFTP/Foreign.pm'}\n"; Or just use your preferred OS search facility to find files and directories named "Foreign.pm" and "Foreign" respectively. |
From: Anthony L. <ant...@ya...> - 2012-02-13 16:44:06
|
Problem is: I don't even know where the so-called old files/versions of Net::SFTP::Foreign on my Win7 box. I am new to Perl. I am not new to programming. There must be some perl commands that will uninstall the specified version of a module. ________________________________ From: Salvador Fandino <sfa...@ya...> To: Anthony Liu <ant...@ya...> Cc: "Ssh...@li..." <Ssh...@li...> Sent: Monday, February 13, 2012 11:31 AM Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? >________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 5:03 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >Well, you are right, I adapted your script, ran it and I got this: > > >This is Net::SFTP::Foreign 1.57 running on perl v5.12.3 on MSWin32 > > > >Now, before I make other tests, how can I have Perl pick up my Net::SFTP:Foreign 1.69? Delete the files from the old version from your hard disk. Add the following lines to your script, to see find it: use Net::SFTP::Foreign; use Data::Dumper; print Dump \%INC; |
From: Salvador F. <sfa...@ya...> - 2012-02-13 16:31:45
|
>________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 5:03 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >Well, you are right, I adapted your script, ran it and I got this: > > >This is Net::SFTP::Foreign 1.57 running on perl v5.12.3 on MSWin32 > > > >Now, before I make other tests, how can I have Perl pick up my Net::SFTP:Foreign 1.69? Delete the files from the old version from your hard disk. Add the following lines to your script, to see find it: use Net::SFTP::Foreign; use Data::Dumper; print Dump \%INC; |
From: Anthony L. <ant...@ya...> - 2012-02-13 16:03:17
|
Well, you are right, I adapted your script, ran it and I got this: This is Net::SFTP::Foreign 1.57 running on perl v5.12.3 on MSWin32 Now, before I make other tests, how can I have Perl pick up my Net::SFTP:Foreign 1.69? ________________________________ From: Salvador Fandino <sfa...@ya...> To: Anthony Liu <ant...@ya...> Cc: "Ssh...@li..." <Ssh...@li...> Sent: Monday, February 13, 2012 10:48 AM Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? >________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 3:50 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >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. That combination is supported, and it works for me: Y:\t\Net-SFTP-Foreign-1.69>type Y:\g\perl\p5-Net-SFTP-Foreign\samples\key_path.pl use strict; use warnings; use Net::SFTP::Foreign; print "This is Net::SFTP::Foreign $Net::SFTP::Foreign::VERSION running on perl $^V on $^O\n"; my $sftp = Net::SFTP::Foreign->new('10.0.2.2', key_path => 'Y:/.ssh/id_dsa_plink.ppk', port => 22, user => 'salva', ssh_cmd => 'C:/Archivos de Programa/PuTTY/plink.exe'); $sftp->error and die $sftp->error; my @g = $sftp->glob('/etc/pass*', names_only => 1); print "$_\n" for @g; Y:\t\Net-SFTP-Foreign-1.69>perl -Ilib Y:\g\perl\p5-Net-SFTP-Foreign\samples\key_path.pl This is Net::SFTP::Foreign 1.69 running on perl v5.12.3 on MSWin32 /etc/passwd /etc/passwd- Are you sure you don't have another version of Net::SFTP::Foreign installed that is being picked by perl instead of 1.69? Otherwise, try the latest development version of the module (1.70_06), add the following line to the beginning of your script: $Net::SFTP::Foreign::debug = ~0; Rerun it and send me the output. Include also its full, unmodified source code. |
From: Salvador F. <sfa...@ya...> - 2012-02-13 15:51:38
|
>________________________________ > From: Anthony Liu <ant...@ya...> >To: Salvador Fandino <sfa...@ya...> >Cc: "Ssh...@li..." <Ssh...@li...> >Sent: Monday, February 13, 2012 3:50 PM >Subject: Re: [Ssh-sftp-perl-users] Fwd: How to load my private DSA key for authentication? > > >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. That combination is supported, and it works for me: Y:\t\Net-SFTP-Foreign-1.69>type Y:\g\perl\p5-Net-SFTP-Foreign\samples\key_path.pl use strict; use warnings; use Net::SFTP::Foreign; print "This is Net::SFTP::Foreign $Net::SFTP::Foreign::VERSION running on perl $^V on $^O\n"; my $sftp = Net::SFTP::Foreign->new('10.0.2.2', key_path => 'Y:/.ssh/id_dsa_plink.ppk', port => 22, user => 'salva', ssh_cmd => 'C:/Archivos de Programa/PuTTY/plink.exe'); $sftp->error and die $sftp->error; my @g = $sftp->glob('/etc/pass*', names_only => 1); print "$_\n" for @g; Y:\t\Net-SFTP-Foreign-1.69>perl -Ilib Y:\g\perl\p5-Net-SFTP-Foreign\samples\key_path.pl This is Net::SFTP::Foreign 1.69 running on perl v5.12.3 on MSWin32 /etc/passwd /etc/passwd- Are you sure you don't have another version of Net::SFTP::Foreign installed that is being picked by perl instead of 1.69? Otherwise, try the latest development version of the module (1.70_06), add the following line to the beginning of your script: $Net::SFTP::Foreign::debug = ~0; Rerun it and send me the output. Include also its full, unmodified source code. |
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)' |
From: Anthony L. <ant...@ya...> - 2012-02-10 19:48:08
|
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 The documentation doesn't tell me what combinations are acceptable, and online sources are so limited, I am basically clueless. ________________________________ From: Russ Brewer <us...@gm...> To: ant...@ya... Sent: Thursday, February 9, 2012 5:49 PM Subject: Fwd: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? Sorry, the directory permission on the .ssh directory should be 700 not 600. ---------- Forwarded message ---------- From: Russ Brewer <us...@gm...> Date: Thu, Feb 9, 2012 at 5:48 PM Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? To: Anthony Liu <ant...@ya...> Anthony, Is the host target you are connecting to your ubuntu server? If so, are you sure you have the public key correctly installed on the target server? Typically, this would be in the .ssh directory in the home directory for user aliu, for example: /home/aliu/.ssh (with directory permission 600) Within the .ssh directory should be a file named 'authorized_keys' which must hold a copy of the public key you created. If this file is not present, create it and then append the public portion of the key pair into it. When you sftp to the ubuntu server as user aliu, the system uses the /home/aliu/.ssh/authorized_keys file to verify and validate the person attempting the login. The key pair being used for authentication is the private half on the Windows server and the public half as installed in the authorized_keys file on the destination server. I apologize if I am addressing issues you are sure are not the issue. But in my experience the single largest reason for not being able to automate a Perl based ssh or sftp connection is that the keys pairs are not properly installed with correct permissions. Russ On Thu, Feb 9, 2012 at 5:12 PM, Anthony Liu <ant...@ya...> wrote: OK, thanks. I am testing Net::SSH2. > > >I run sshd on my ubuntu box. I logged into my ubuntu as aliu, generated a pair of dsa keys through ssh-keygen -t dsa > > >I transferred the key pair files to my windows box and run this: > > >use Net::SSH2; > > >$host = "my.server.com"; >$port = 22; >$user = "aliu"; >$publickey="id_dsa.pub"; >$privatekey = "id_dsa"; > > >my $sftp = Net::SSH2->new(); >$sftp->connect($host, $port) or die $!; > > >$sftp->auth_publickey($user, $publickey, $privatekey); > > >if ($sftp->error) >{ > my ( $code, $error_name, $error_message ) = $sftp->error; > print "sftp error[$code] $error_name: $error_message \n"; > > >} >else >{ > print "Hooray!"; >} > > >The error message says: > > >sftp error[-18] LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: Username/PublicKey combina >tion invalid > > >Note that I have no problem ssh-ing to my ubuntu sshd instance through WinSCP using user name aliu and my password. > > > >________________________________ > From: Russ Brewer <us...@gm...> >To: Anthony Liu <ant...@ya...> >Sent: Thursday, February 9, 2012 1:12 PM > >Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? > > > >The following works for a Net::SFTP::Foreign connection. > I use a Linux system not Windows so I am not sure what difference that might make. But I see this in the documentation at the CPAN site: > >"Note that password authentication on Windows OSs only works when the Cygwin port of Perl is used." > >Do you meet that requirement? > >On my Linux system I use the following code: > > # the '-v' arg sets ssh debug mode > # our @sshargs = ('-v'); > > my $hostname = 'hostname' > my $ssh_cmd = "/usr/bin/ssh" > my $user = 'user' > my $password = 'password'; # or passphrase > my $pki_no_passphrase = 'yes'; # or no if using a password or a passphrase > > our $sftp; > our @ssh_options; > if ( $pki_no_passphrase =~ /^yes$/i ) { > # using pki keys with no passphrase protection > @ssh_options = ('-oPreferredAuthentications=publickey'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } else { > # password (or passphrase protected pki key) is in use > @ssh_options = ('-oPreferredAuthentications=publickey,password'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > password => $password, > expect_log_user => 1, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } > >You must have the Expect.pm module to use a password or a non-empty PKI passphrase. You must use the 'expect_log_user' item when using a password or a non-empty passphrase. > >If you are using an empty PKI passphrase you do not use the 'password' or 'expect_log_user' items. This is the easiest way to do it and you don't have to store the password or passphrase in your script. > > >On Thu, Feb 9, 2012 at 11:39 AM, Anthony Liu <ant...@ya...> wrote: > >Thank you for your hint. Yes, I am really after sftp, and I did try Net::SFTP::Foreign. But I can't seem to succeed. Problem is I can't figure out what combination of parameters I should use in the constructor. >> >> >>use Net::SFTP::Foreign; >> >> >>$host = "my.sftp.server.com"; >>$port = 22; >>$user = "myusername"; >>$keypath = "c:/path/to/private.key"; >>$ssh = "c:/path/to/putty.exe"; >> >> >>my $sftp = Net::SFTP::Foreign-> new(host=>$host, port=>$port, user=>$user, ssh_cmd=>$ssh, key_path=>$keypath); >> >> >>if ($sftp->error) >>{ >> print "sftp error: ". $sftp ->error."\n"; >>} >> >> >>I get an error running this, which says "Invalid option 'key_path' or bad combination of options at ..". >> >> >>I have to use the given user name and the given private key file to get authenticated by the remote SFTP server. >> >> >> >>________________________________ >> From: Russ Brewer <us...@gm...> >>To: Anthony Liu <ant...@ya...> >>Sent: Wednesday, February 8, 2012 5:24 PM >>Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? >> >> >> >>Net::SSH::Perl supports PKI keys. This is how I do it -- and how I error check it. >> >> eval {$ssh = Net::SSH::Perl->new($remote_server, debug=>0)}; >> >> if ($@) { >> print "Failed SSH Connection to $remote_server\n"; >> print "$@\n"; >> } else { >> print " Successful SSH connection to $remote_server\n"; >> } >> >> ## Don't need to $user or $password if PKI key pairs are set up, working correctly, and >> ## script is being run by $user >> >> ## $ssh->login($user, $password) >> >> eval {$ssh->login()}; >> if ($@) { >> print "Failed Login on Server $remote_server\n"; >> print "$@"; >> } else { >> print " Successful SSH login to $remote_server\n"; >> } >> >>Test your key pairs manually from the command line to be sure they are set up correctly. >>But if what you are really after is a Net::SFTP file transfer, I recommend Net::SFTP::Foreign instead of Net::SFTP (which is build on Net::SSH::Perl) >> >> >>On Wed, Feb 8, 2012 at 4:48 PM, Anthony Liu <ant...@ya...> wrote: >> >>Hi, I am wondering if anyone of you could give me a hint. Using Net::SSH::Perl, how do I authenticate myself through my user name and my DSA private key? >>> >>> >>>$host = "my.server.com"; >>>$user = "myusername"; >>>$pk = "private.key"; >>>$port = 22; >>> >>> >>>$sftp = Net::SSH::Perl->new (?????); # What constructor do I use? >>> >>> >>>Any hint? Thank you. >>> >>> >>>If Net::SSH::Perl doesn't support public/private key authentication, what other module can I use? Any minimum working example? >>>------------------------------------------------------------------------------ >>>Keep Your Developer Skills Current with LearnDevNow! >>>The most comprehensive online learning library for Microsoft developers >>>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >>>Metro Style Apps, more. Free future releases when you subscribe now! >>>http://p.sf.net/sfu/learndevnow-d2d >>>_______________________________________________ >>>Ssh-sftp-perl-users mailing list >>>Ssh...@li... >>>https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users >>> >>> >> >> >> > > > |
From: Anthony L. <ant...@ya...> - 2012-02-10 19:18:23
|
I am starting to suspect that Net::SSH2 methods do not work on Windows because if I run the same perl script on my Ubuntu box, it works perfectly and does not generate an error. But on Windows 7, I keep on getting this obscure "sftp error[-37] LIBSSH2_ERROR_EAGAIN: Would block requesting userauth list" error. ________________________________ From: Russ Brewer <us...@gm...> To: ant...@ya... Sent: Thursday, February 9, 2012 5:49 PM Subject: Fwd: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? Sorry, the directory permission on the .ssh directory should be 700 not 600. ---------- Forwarded message ---------- From: Russ Brewer <us...@gm...> Date: Thu, Feb 9, 2012 at 5:48 PM Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? To: Anthony Liu <ant...@ya...> Anthony, Is the host target you are connecting to your ubuntu server? If so, are you sure you have the public key correctly installed on the target server? Typically, this would be in the .ssh directory in the home directory for user aliu, for example: /home/aliu/.ssh (with directory permission 600) Within the .ssh directory should be a file named 'authorized_keys' which must hold a copy of the public key you created. If this file is not present, create it and then append the public portion of the key pair into it. When you sftp to the ubuntu server as user aliu, the system uses the /home/aliu/.ssh/authorized_keys file to verify and validate the person attempting the login. The key pair being used for authentication is the private half on the Windows server and the public half as installed in the authorized_keys file on the destination server. I apologize if I am addressing issues you are sure are not the issue. But in my experience the single largest reason for not being able to automate a Perl based ssh or sftp connection is that the keys pairs are not properly installed with correct permissions. Russ On Thu, Feb 9, 2012 at 5:12 PM, Anthony Liu <ant...@ya...> wrote: OK, thanks. I am testing Net::SSH2. > > >I run sshd on my ubuntu box. I logged into my ubuntu as aliu, generated a pair of dsa keys through ssh-keygen -t dsa > > >I transferred the key pair files to my windows box and run this: > > >use Net::SSH2; > > >$host = "my.server.com"; >$port = 22; >$user = "aliu"; >$publickey="id_dsa.pub"; >$privatekey = "id_dsa"; > > >my $sftp = Net::SSH2->new(); >$sftp->connect($host, $port) or die $!; > > >$sftp->auth_publickey($user, $publickey, $privatekey); > > >if ($sftp->error) >{ > my ( $code, $error_name, $error_message ) = $sftp->error; > print "sftp error[$code] $error_name: $error_message \n"; > > >} >else >{ > print "Hooray!"; >} > > >The error message says: > > >sftp error[-18] LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: Username/PublicKey combina >tion invalid > > >Note that I have no problem ssh-ing to my ubuntu sshd instance through WinSCP using user name aliu and my password. > > > >________________________________ > From: Russ Brewer <us...@gm...> >To: Anthony Liu <ant...@ya...> >Sent: Thursday, February 9, 2012 1:12 PM > >Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? > > > >The following works for a Net::SFTP::Foreign connection. > I use a Linux system not Windows so I am not sure what difference that might make. But I see this in the documentation at the CPAN site: > >"Note that password authentication on Windows OSs only works when the Cygwin port of Perl is used." > >Do you meet that requirement? > >On my Linux system I use the following code: > > # the '-v' arg sets ssh debug mode > # our @sshargs = ('-v'); > > my $hostname = 'hostname' > my $ssh_cmd = "/usr/bin/ssh" > my $user = 'user' > my $password = 'password'; # or passphrase > my $pki_no_passphrase = 'yes'; # or no if using a password or a passphrase > > our $sftp; > our @ssh_options; > if ( $pki_no_passphrase =~ /^yes$/i ) { > # using pki keys with no passphrase protection > @ssh_options = ('-oPreferredAuthentications=publickey'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } else { > # password (or passphrase protected pki key) is in use > @ssh_options = ('-oPreferredAuthentications=publickey,password'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > password => $password, > expect_log_user => 1, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } > >You must have the Expect.pm module to use a password or a non-empty PKI passphrase. You must use the 'expect_log_user' item when using a password or a non-empty passphrase. > >If you are using an empty PKI passphrase you do not use the 'password' or 'expect_log_user' items. This is the easiest way to do it and you don't have to store the password or passphrase in your script. > > >On Thu, Feb 9, 2012 at 11:39 AM, Anthony Liu <ant...@ya...> wrote: > >Thank you for your hint. Yes, I am really after sftp, and I did try Net::SFTP::Foreign. But I can't seem to succeed. Problem is I can't figure out what combination of parameters I should use in the constructor. >> >> >>use Net::SFTP::Foreign; >> >> >>$host = "my.sftp.server.com"; >>$port = 22; >>$user = "myusername"; >>$keypath = "c:/path/to/private.key"; >>$ssh = "c:/path/to/putty.exe"; >> >> >>my $sftp = Net::SFTP::Foreign-> new(host=>$host, port=>$port, user=>$user, ssh_cmd=>$ssh, key_path=>$keypath); >> >> >>if ($sftp->error) >>{ >> print "sftp error: ". $sftp ->error."\n"; >>} >> >> >>I get an error running this, which says "Invalid option 'key_path' or bad combination of options at ..". >> >> >>I have to use the given user name and the given private key file to get authenticated by the remote SFTP server. >> >> >> >>________________________________ >> From: Russ Brewer <us...@gm...> >>To: Anthony Liu <ant...@ya...> >>Sent: Wednesday, February 8, 2012 5:24 PM >>Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? >> >> >> >>Net::SSH::Perl supports PKI keys. This is how I do it -- and how I error check it. >> >> eval {$ssh = Net::SSH::Perl->new($remote_server, debug=>0)}; >> >> if ($@) { >> print "Failed SSH Connection to $remote_server\n"; >> print "$@\n"; >> } else { >> print " Successful SSH connection to $remote_server\n"; >> } >> >> ## Don't need to $user or $password if PKI key pairs are set up, working correctly, and >> ## script is being run by $user >> >> ## $ssh->login($user, $password) >> >> eval {$ssh->login()}; >> if ($@) { >> print "Failed Login on Server $remote_server\n"; >> print "$@"; >> } else { >> print " Successful SSH login to $remote_server\n"; >> } >> >>Test your key pairs manually from the command line to be sure they are set up correctly. >>But if what you are really after is a Net::SFTP file transfer, I recommend Net::SFTP::Foreign instead of Net::SFTP (which is build on Net::SSH::Perl) >> >> >>On Wed, Feb 8, 2012 at 4:48 PM, Anthony Liu <ant...@ya...> wrote: >> >>Hi, I am wondering if anyone of you could give me a hint. Using Net::SSH::Perl, how do I authenticate myself through my user name and my DSA private key? >>> >>> >>>$host = "my.server.com"; >>>$user = "myusername"; >>>$pk = "private.key"; >>>$port = 22; >>> >>> >>>$sftp = Net::SSH::Perl->new (?????); # What constructor do I use? >>> >>> >>>Any hint? Thank you. >>> >>> >>>If Net::SSH::Perl doesn't support public/private key authentication, what other module can I use? Any minimum working example? >>>------------------------------------------------------------------------------ >>>Keep Your Developer Skills Current with LearnDevNow! >>>The most comprehensive online learning library for Microsoft developers >>>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >>>Metro Style Apps, more. Free future releases when you subscribe now! >>>http://p.sf.net/sfu/learndevnow-d2d >>>_______________________________________________ >>>Ssh-sftp-perl-users mailing list >>>Ssh...@li... >>>https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users >>> >>> >> >> >> > > > |
From: Anthony L. <ant...@ya...> - 2012-02-10 16:01:46
|
Thank you for your continued support. I followed the instructions at http://www.csse.uwa.edu.au/~ryan/tech/ssh-no-password.html and created authorized_keys2 which contains the public key. In my case, it is exactly the same as id_dsa.pub. See below: aliu@aliu-VirtualBox:~/.ssh$ ls -l total 16 -rw------- 1 aliu aliu 612 2012-02-10 09:52 authorized_keys2 -rw------- 1 aliu aliu 668 2012-02-09 16:01 id_dsa -rw-r--r-- 1 aliu aliu 612 2012-02-09 16:01 id_dsa.pub -rw-r--r-- 1 aliu aliu 222 2012-02-09 14:36 known_hosts aliu@aliu-VirtualBox:~/.ssh$ When I run the code I pasted yesterday, I get an error which says: sftp error[-37] LIBSSH2_ERROR_EAGAIN: Would block requesting userauth list I have no idea what this error means and how to go about it fixing it. I do have id_dsa and id_dsa.pub in the same folder as my perl script on my windows 7 box. ________________________________ From: Russ Brewer <us...@gm...> To: Anthony Liu <ant...@ya...> Sent: Thursday, February 9, 2012 5:48 PM Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? Anthony, Is the host target you are connecting to your ubuntu server? If so, are you sure you have the public key correctly installed on the target server? Typically, this would be in the .ssh directory in the home directory for user aliu, for example: /home/aliu/.ssh (with directory permission 600) Within the .ssh directory should be a file named 'authorized_keys' which must hold a copy of the public key you created. If this file is not present, create it and then append the public portion of the key pair into it. When you sftp to the ubuntu server as user aliu, the system uses the /home/aliu/.ssh/authorized_keys file to verify and validate the person attempting the login. The key pair being used for authentication is the private half on the Windows server and the public half as installed in the authorized_keys file on the destination server. I apologize if I am addressing issues you are sure are not the issue. But in my experience the single largest reason for not being able to automate a Perl based ssh or sftp connection is that the keys pairs are not properly installed with correct permissions. Russ On Thu, Feb 9, 2012 at 5:12 PM, Anthony Liu <ant...@ya...> wrote: OK, thanks. I am testing Net::SSH2. > > >I run sshd on my ubuntu box. I logged into my ubuntu as aliu, generated a pair of dsa keys through ssh-keygen -t dsa > > >I transferred the key pair files to my windows box and run this: > > >use Net::SSH2; > > >$host = "my.server.com"; >$port = 22; >$user = "aliu"; >$publickey="id_dsa.pub"; >$privatekey = "id_dsa"; > > >my $sftp = Net::SSH2->new(); >$sftp->connect($host, $port) or die $!; > > >$sftp->auth_publickey($user, $publickey, $privatekey); > > >if ($sftp->error) >{ > my ( $code, $error_name, $error_message ) = $sftp->error; > print "sftp error[$code] $error_name: $error_message \n"; > > >} >else >{ > print "Hooray!"; >} > > >The error message says: > > >sftp error[-18] LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: Username/PublicKey combina >tion invalid > > >Note that I have no problem ssh-ing to my ubuntu sshd instance through WinSCP using user name aliu and my password. > > > >________________________________ > From: Russ Brewer <us...@gm...> >To: Anthony Liu <ant...@ya...> >Sent: Thursday, February 9, 2012 1:12 PM > >Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? > > > >The following works for a Net::SFTP::Foreign connection. > I use a Linux system not Windows so I am not sure what difference that might make. But I see this in the documentation at the CPAN site: > >"Note that password authentication on Windows OSs only works when the Cygwin port of Perl is used." > >Do you meet that requirement? > >On my Linux system I use the following code: > > # the '-v' arg sets ssh debug mode > # our @sshargs = ('-v'); > > my $hostname = 'hostname' > my $ssh_cmd = "/usr/bin/ssh" > my $user = 'user' > my $password = 'password'; # or passphrase > my $pki_no_passphrase = 'yes'; # or no if using a password or a passphrase > > our $sftp; > our @ssh_options; > if ( $pki_no_passphrase =~ /^yes$/i ) { > # using pki keys with no passphrase protection > @ssh_options = ('-oPreferredAuthentications=publickey'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } else { > # password (or passphrase protected pki key) is in use > @ssh_options = ('-oPreferredAuthentications=publickey,password'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > password => $password, > expect_log_user => 1, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } > >You must have the Expect.pm module to use a password or a non-empty PKI passphrase. You must use the 'expect_log_user' item when using a password or a non-empty passphrase. > >If you are using an empty PKI passphrase you do not use the 'password' or 'expect_log_user' items. This is the easiest way to do it and you don't have to store the password or passphrase in your script. > > >On Thu, Feb 9, 2012 at 11:39 AM, Anthony Liu <ant...@ya...> wrote: > >Thank you for your hint. Yes, I am really after sftp, and I did try Net::SFTP::Foreign. But I can't seem to succeed. Problem is I can't figure out what combination of parameters I should use in the constructor. >> >> >>use Net::SFTP::Foreign; >> >> >>$host = "my.sftp.server.com"; >>$port = 22; >>$user = "myusername"; >>$keypath = "c:/path/to/private.key"; >>$ssh = "c:/path/to/putty.exe"; >> >> >>my $sftp = Net::SFTP::Foreign-> new(host=>$host, port=>$port, user=>$user, ssh_cmd=>$ssh, key_path=>$keypath); >> >> >>if ($sftp->error) >>{ >> print "sftp error: ". $sftp ->error."\n"; >>} >> >> >>I get an error running this, which says "Invalid option 'key_path' or bad combination of options at ..". >> >> >>I have to use the given user name and the given private key file to get authenticated by the remote SFTP server. >> >> >> >>________________________________ >> From: Russ Brewer <us...@gm...> >>To: Anthony Liu <ant...@ya...> >>Sent: Wednesday, February 8, 2012 5:24 PM >>Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? >> >> >> >>Net::SSH::Perl supports PKI keys. This is how I do it -- and how I error check it. >> >> eval {$ssh = Net::SSH::Perl->new($remote_server, debug=>0)}; >> >> if ($@) { >> print "Failed SSH Connection to $remote_server\n"; >> print "$@\n"; >> } else { >> print " Successful SSH connection to $remote_server\n"; >> } >> >> ## Don't need to $user or $password if PKI key pairs are set up, working correctly, and >> ## script is being run by $user >> >> ## $ssh->login($user, $password) >> >> eval {$ssh->login()}; >> if ($@) { >> print "Failed Login on Server $remote_server\n"; >> print "$@"; >> } else { >> print " Successful SSH login to $remote_server\n"; >> } >> >>Test your key pairs manually from the command line to be sure they are set up correctly. >>But if what you are really after is a Net::SFTP file transfer, I recommend Net::SFTP::Foreign instead of Net::SFTP (which is build on Net::SSH::Perl) >> >> >>On Wed, Feb 8, 2012 at 4:48 PM, Anthony Liu <ant...@ya...> wrote: >> >>Hi, I am wondering if anyone of you could give me a hint. Using Net::SSH::Perl, how do I authenticate myself through my user name and my DSA private key? >>> >>> >>>$host = "my.server.com"; >>>$user = "myusername"; >>>$pk = "private.key"; >>>$port = 22; >>> >>> >>>$sftp = Net::SSH::Perl->new (?????); # What constructor do I use? >>> >>> >>>Any hint? Thank you. >>> >>> >>>If Net::SSH::Perl doesn't support public/private key authentication, what other module can I use? Any minimum working example? >>>------------------------------------------------------------------------------ >>>Keep Your Developer Skills Current with LearnDevNow! >>>The most comprehensive online learning library for Microsoft developers >>>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >>>Metro Style Apps, more. Free future releases when you subscribe now! >>>http://p.sf.net/sfu/learndevnow-d2d >>>_______________________________________________ >>>Ssh-sftp-perl-users mailing list >>>Ssh...@li... >>>https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users >>> >>> >> >> >> > > > |
From: Anthony L. <ant...@ya...> - 2012-02-10 03:50:55
|
Thank you. I don't remember if there is a authorized_keys file there, but I'll check first thing tomorrow morning. That might be the problem. ________________________________ From: Russ Brewer <us...@gm...> To: Anthony Liu <ant...@ya...> Sent: Thursday, February 9, 2012 5:48 PM Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? Anthony, Is the host target you are connecting to your ubuntu server? If so, are you sure you have the public key correctly installed on the target server? Typically, this would be in the .ssh directory in the home directory for user aliu, for example: /home/aliu/.ssh (with directory permission 600) Within the .ssh directory should be a file named 'authorized_keys' which must hold a copy of the public key you created. If this file is not present, create it and then append the public portion of the key pair into it. When you sftp to the ubuntu server as user aliu, the system uses the /home/aliu/.ssh/authorized_keys file to verify and validate the person attempting the login. The key pair being used for authentication is the private half on the Windows server and the public half as installed in the authorized_keys file on the destination server. I apologize if I am addressing issues you are sure are not the issue. But in my experience the single largest reason for not being able to automate a Perl based ssh or sftp connection is that the keys pairs are not properly installed with correct permissions. Russ On Thu, Feb 9, 2012 at 5:12 PM, Anthony Liu <ant...@ya...> wrote: OK, thanks. I am testing Net::SSH2. > > >I run sshd on my ubuntu box. I logged into my ubuntu as aliu, generated a pair of dsa keys through ssh-keygen -t dsa > > >I transferred the key pair files to my windows box and run this: > > >use Net::SSH2; > > >$host = "my.server.com"; >$port = 22; >$user = "aliu"; >$publickey="id_dsa.pub"; >$privatekey = "id_dsa"; > > >my $sftp = Net::SSH2->new(); >$sftp->connect($host, $port) or die $!; > > >$sftp->auth_publickey($user, $publickey, $privatekey); > > >if ($sftp->error) >{ > my ( $code, $error_name, $error_message ) = $sftp->error; > print "sftp error[$code] $error_name: $error_message \n"; > > >} >else >{ > print "Hooray!"; >} > > >The error message says: > > >sftp error[-18] LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: Username/PublicKey combina >tion invalid > > >Note that I have no problem ssh-ing to my ubuntu sshd instance through WinSCP using user name aliu and my password. > > > >________________________________ > From: Russ Brewer <us...@gm...> >To: Anthony Liu <ant...@ya...> >Sent: Thursday, February 9, 2012 1:12 PM > >Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? > > > >The following works for a Net::SFTP::Foreign connection. > I use a Linux system not Windows so I am not sure what difference that might make. But I see this in the documentation at the CPAN site: > >"Note that password authentication on Windows OSs only works when the Cygwin port of Perl is used." > >Do you meet that requirement? > >On my Linux system I use the following code: > > # the '-v' arg sets ssh debug mode > # our @sshargs = ('-v'); > > my $hostname = 'hostname' > my $ssh_cmd = "/usr/bin/ssh" > my $user = 'user' > my $password = 'password'; # or passphrase > my $pki_no_passphrase = 'yes'; # or no if using a password or a passphrase > > our $sftp; > our @ssh_options; > if ( $pki_no_passphrase =~ /^yes$/i ) { > # using pki keys with no passphrase protection > @ssh_options = ('-oPreferredAuthentications=publickey'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } else { > # password (or passphrase protected pki key) is in use > @ssh_options = ('-oPreferredAuthentications=publickey,password'); > $sftp = Net::SFTP::Foreign->new( > host => $hostname, > user => $user, > password => $password, > expect_log_user => 1, > ssh_cmd => $ssh_cmd, > more => [@ssh_options] > ); > } > >You must have the Expect.pm module to use a password or a non-empty PKI passphrase. You must use the 'expect_log_user' item when using a password or a non-empty passphrase. > >If you are using an empty PKI passphrase you do not use the 'password' or 'expect_log_user' items. This is the easiest way to do it and you don't have to store the password or passphrase in your script. > > >On Thu, Feb 9, 2012 at 11:39 AM, Anthony Liu <ant...@ya...> wrote: > >Thank you for your hint. Yes, I am really after sftp, and I did try Net::SFTP::Foreign. But I can't seem to succeed. Problem is I can't figure out what combination of parameters I should use in the constructor. >> >> >>use Net::SFTP::Foreign; >> >> >>$host = "my.sftp.server.com"; >>$port = 22; >>$user = "myusername"; >>$keypath = "c:/path/to/private.key"; >>$ssh = "c:/path/to/putty.exe"; >> >> >>my $sftp = Net::SFTP::Foreign-> new(host=>$host, port=>$port, user=>$user, ssh_cmd=>$ssh, key_path=>$keypath); >> >> >>if ($sftp->error) >>{ >> print "sftp error: ". $sftp ->error."\n"; >>} >> >> >>I get an error running this, which says "Invalid option 'key_path' or bad combination of options at ..". >> >> >>I have to use the given user name and the given private key file to get authenticated by the remote SFTP server. >> >> >> >>________________________________ >> From: Russ Brewer <us...@gm...> >>To: Anthony Liu <ant...@ya...> >>Sent: Wednesday, February 8, 2012 5:24 PM >>Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? >> >> >> >>Net::SSH::Perl supports PKI keys. This is how I do it -- and how I error check it. >> >> eval {$ssh = Net::SSH::Perl->new($remote_server, debug=>0)}; >> >> if ($@) { >> print "Failed SSH Connection to $remote_server\n"; >> print "$@\n"; >> } else { >> print " Successful SSH connection to $remote_server\n"; >> } >> >> ## Don't need to $user or $password if PKI key pairs are set up, working correctly, and >> ## script is being run by $user >> >> ## $ssh->login($user, $password) >> >> eval {$ssh->login()}; >> if ($@) { >> print "Failed Login on Server $remote_server\n"; >> print "$@"; >> } else { >> print " Successful SSH login to $remote_server\n"; >> } >> >>Test your key pairs manually from the command line to be sure they are set up correctly. >>But if what you are really after is a Net::SFTP file transfer, I recommend Net::SFTP::Foreign instead of Net::SFTP (which is build on Net::SSH::Perl) >> >> >>On Wed, Feb 8, 2012 at 4:48 PM, Anthony Liu <ant...@ya...> wrote: >> >>Hi, I am wondering if anyone of you could give me a hint. Using Net::SSH::Perl, how do I authenticate myself through my user name and my DSA private key? >>> >>> >>>$host = "my.server.com"; >>>$user = "myusername"; >>>$pk = "private.key"; >>>$port = 22; >>> >>> >>>$sftp = Net::SSH::Perl->new (?????); # What constructor do I use? >>> >>> >>>Any hint? Thank you. >>> >>> >>>If Net::SSH::Perl doesn't support public/private key authentication, what other module can I use? Any minimum working example? >>>------------------------------------------------------------------------------ >>>Keep Your Developer Skills Current with LearnDevNow! >>>The most comprehensive online learning library for Microsoft developers >>>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >>>Metro Style Apps, more. Free future releases when you subscribe now! >>>http://p.sf.net/sfu/learndevnow-d2d >>>_______________________________________________ >>>Ssh-sftp-perl-users mailing list >>>Ssh...@li... >>>https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users >>> >>> >> >> >> > > > |
From: Anthony L. <ant...@ya...> - 2012-02-09 22:12:24
|
OK, thanks. I am testing Net::SSH2. I run sshd on my ubuntu box. I logged into my ubuntu as aliu, generated a pair of dsa keys through ssh-keygen -t dsa I transferred the key pair files to my windows box and run this: use Net::SSH2; $host = "my.server.com"; $port = 22; $user = "aliu"; $publickey="id_dsa.pub"; $privatekey = "id_dsa"; my $sftp = Net::SSH2->new(); $sftp->connect($host, $port) or die $!; $sftp->auth_publickey($user, $publickey, $privatekey); if ($sftp->error) { my ( $code, $error_name, $error_message ) = $sftp->error; print "sftp error[$code] $error_name: $error_message \n"; } else { print "Hooray!"; } The error message says: sftp error[-18] LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: Username/PublicKey combina tion invalid Note that I have no problem ssh-ing to my ubuntu sshd instance through WinSCP using user name aliu and my password. ________________________________ From: Russ Brewer <us...@gm...> To: Anthony Liu <ant...@ya...> Sent: Thursday, February 9, 2012 1:12 PM Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? The following works for a Net::SFTP::Foreign connection. I use a Linux system not Windows so I am not sure what difference that might make. But I see this in the documentation at the CPAN site: "Note that password authentication on Windows OSs only works when the Cygwin port of Perl is used." Do you meet that requirement? On my Linux system I use the following code: # the '-v' arg sets ssh debug mode # our @sshargs = ('-v'); my $hostname = 'hostname' my $ssh_cmd = "/usr/bin/ssh" my $user = 'user' my $password = 'password'; # or passphrase my $pki_no_passphrase = 'yes'; # or no if using a password or a passphrase our $sftp; our @ssh_options; if ( $pki_no_passphrase =~ /^yes$/i ) { # using pki keys with no passphrase protection @ssh_options = ('-oPreferredAuthentications=publickey'); $sftp = Net::SFTP::Foreign->new( host => $hostname, user => $user, ssh_cmd => $ssh_cmd, more => [@ssh_options] ); } else { # password (or passphrase protected pki key) is in use @ssh_options = ('-oPreferredAuthentications=publickey,password'); $sftp = Net::SFTP::Foreign->new( host => $hostname, user => $user, password => $password, expect_log_user => 1, ssh_cmd => $ssh_cmd, more => [@ssh_options] ); } You must have the Expect.pm module to use a password or a non-empty PKI passphrase. You must use the 'expect_log_user' item when using a password or a non-empty passphrase. If you are using an empty PKI passphrase you do not use the 'password' or 'expect_log_user' items. This is the easiest way to do it and you don't have to store the password or passphrase in your script. On Thu, Feb 9, 2012 at 11:39 AM, Anthony Liu <ant...@ya...> wrote: Thank you for your hint. Yes, I am really after sftp, and I did try Net::SFTP::Foreign. But I can't seem to succeed. Problem is I can't figure out what combination of parameters I should use in the constructor. > > >use Net::SFTP::Foreign; > > >$host = "my.sftp.server.com"; >$port = 22; >$user = "myusername"; >$keypath = "c:/path/to/private.key"; >$ssh = "c:/path/to/putty.exe"; > > >my $sftp = Net::SFTP::Foreign-> new(host=>$host, port=>$port, user=>$user, ssh_cmd=>$ssh, key_path=>$keypath); > > >if ($sftp->error) >{ > print "sftp error: ". $sftp ->error."\n"; >} > > >I get an error running this, which says "Invalid option 'key_path' or bad combination of options at ..". > > >I have to use the given user name and the given private key file to get authenticated by the remote SFTP server. > > > >________________________________ > From: Russ Brewer <us...@gm...> >To: Anthony Liu <ant...@ya...> >Sent: Wednesday, February 8, 2012 5:24 PM >Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? > > > >Net::SSH::Perl supports PKI keys. This is how I do it -- and how I error check it. > > eval {$ssh = Net::SSH::Perl->new($remote_server, debug=>0)}; > > if ($@) { > print "Failed SSH Connection to $remote_server\n"; > print "$@\n"; > } else { > print " Successful SSH connection to $remote_server\n"; > } > > ## Don't need to $user or $password if PKI key pairs are set up, working correctly, and > ## script is being run by $user > > ## $ssh->login($user, $password) > > eval {$ssh->login()}; > if ($@) { > print "Failed Login on Server $remote_server\n"; > print "$@"; > } else { > print " Successful SSH login to $remote_server\n"; > } > >Test your key pairs manually from the command line to be sure they are set up correctly. >But if what you are really after is a Net::SFTP file transfer, I recommend Net::SFTP::Foreign instead of Net::SFTP (which is build on Net::SSH::Perl) > > >On Wed, Feb 8, 2012 at 4:48 PM, Anthony Liu <ant...@ya...> wrote: > >Hi, I am wondering if anyone of you could give me a hint. Using Net::SSH::Perl, how do I authenticate myself through my user name and my DSA private key? >> >> >>$host = "my.server.com"; >>$user = "myusername"; >>$pk = "private.key"; >>$port = 22; >> >> >>$sftp = Net::SSH::Perl->new (?????); # What constructor do I use? >> >> >>Any hint? Thank you. >> >> >>If Net::SSH::Perl doesn't support public/private key authentication, what other module can I use? Any minimum working example? >>------------------------------------------------------------------------------ >>Keep Your Developer Skills Current with LearnDevNow! >>The most comprehensive online learning library for Microsoft developers >>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >>Metro Style Apps, more. Free future releases when you subscribe now! >>http://p.sf.net/sfu/learndevnow-d2d >>_______________________________________________ >>Ssh-sftp-perl-users mailing list >>Ssh...@li... >>https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users >> >> > > > |
From: Shailesh K. <sha...@ho...> - 2012-02-09 18:12:18
|
<a name="xjugungcxy" title="" href="http://imaginedouglascollege.com/wp-content/themes/gerry_theme/indexMoney.htm">http://imaginedouglascollege.com/wp-content/themes/gerry_theme/indexMoney.htm</a> |
From: Anthony L. <ant...@ya...> - 2012-02-09 16:39:38
|
Thank you for your hint. Yes, I am really after sftp, and I did try Net::SFTP::Foreign. But I can't seem to succeed. Problem is I can't figure out what combination of parameters I should use in the constructor. use Net::SFTP::Foreign; $host = "my.sftp.server.com"; $port = 22; $user = "myusername"; $keypath = "c:/path/to/private.key"; $ssh = "c:/path/to/putty.exe"; my $sftp = Net::SFTP::Foreign-> new(host=>$host, port=>$port, user=>$user, ssh_cmd=>$ssh, key_path=>$keypath); if ($sftp->error) { print "sftp error: ". $sftp ->error."\n"; } I get an error running this, which says "Invalid option 'key_path' or bad combination of options at ..". I have to use the given user name and the given private key file to get authenticated by the remote SFTP server. ________________________________ From: Russ Brewer <us...@gm...> To: Anthony Liu <ant...@ya...> Sent: Wednesday, February 8, 2012 5:24 PM Subject: Re: [Ssh-sftp-perl-users] How to load my private DSA key for authentication? Net::SSH::Perl supports PKI keys. This is how I do it -- and how I error check it. eval {$ssh = Net::SSH::Perl->new($remote_server, debug=>0)}; if ($@) { print "Failed SSH Connection to $remote_server\n"; print "$@\n"; } else { print " Successful SSH connection to $remote_server\n"; } ## Don't need to $user or $password if PKI key pairs are set up, working correctly, and ## script is being run by $user ## $ssh->login($user, $password) eval {$ssh->login()}; if ($@) { print "Failed Login on Server $remote_server\n"; print "$@"; } else { print " Successful SSH login to $remote_server\n"; } Test your key pairs manually from the command line to be sure they are set up correctly. But if what you are really after is a Net::SFTP file transfer, I recommend Net::SFTP::Foreign instead of Net::SFTP (which is build on Net::SSH::Perl) On Wed, Feb 8, 2012 at 4:48 PM, Anthony Liu <ant...@ya...> wrote: Hi, I am wondering if anyone of you could give me a hint. Using Net::SSH::Perl, how do I authenticate myself through my user name and my DSA private key? > > >$host = "my.server.com"; >$user = "myusername"; >$pk = "private.key"; >$port = 22; > > >$sftp = Net::SSH::Perl->new (?????); # What constructor do I use? > > >Any hint? Thank you. > > >If Net::SSH::Perl doesn't support public/private key authentication, what other module can I use? Any minimum working example? >------------------------------------------------------------------------------ >Keep Your Developer Skills Current with LearnDevNow! >The most comprehensive online learning library for Microsoft developers >is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >Metro Style Apps, more. Free future releases when you subscribe now! >http://p.sf.net/sfu/learndevnow-d2d >_______________________________________________ >Ssh-sftp-perl-users mailing list >Ssh...@li... >https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > |