ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 5)
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: Jeremy K. <ki...@sc...> - 2010-08-24 16:59:10
|
On Aug 24, 2010, at 12:54 AM, Richard Thomas wrote: > Hi Jeremy, > > Thank you very much for pointing me in the right direction, it's amazing how simple it is to get past that issue! no problem :) > I will now be following the advice in the following article, as I'm getting the "Channel open failure: 1: reason 4:" error: > > http://cpanforum.com/threads/851 > > Thanks again, you're welcome! -Jeremy |
From: Richard T. <Ric...@th...> - 2010-08-24 15:41:09
|
Hi, Now that I have got past my missing Class::ErrorHandler problem, I have a new one. When I run it, I get the following: #./ciscoprobe.pl : Reading configuration data /root/.ssh/config : Reading configuration data /etc/ssh_config : Connecting to XXX.XXX.XXX.XXX, port 22. : Remote protocol version 2.0, remote software version Cisco-1.25 : Net::SSH::Perl Version 1.34, protocol version 2.0. : No compat match: Cisco-1.25. : Connection established. : Sent key-exchange init (KEXINIT), wait response. : Algorithms, c->s: 3des-cbc hmac-sha1 none : Algorithms, s->c: 3des-cbc hmac-sha1 none : Entering Diffie-Hellman Group 1 key exchange. : Sent DH public key, waiting for reply. : Received host key, type 'ssh-rsa'. : Host 'XXX.XXX.XXX.XXX' is known and matches the host key. : Computing shared secret key. : Verifying server signature. : Waiting for NEWKEYS message. : Send NEWKEYS. : Enabling encryption/MAC/compression. : Sending request for user-authentication service. : Service accepted: ssh-userauth. : Trying empty user-authentication request. : Authentication methods that can continue: keyboard-interactive,password. : Next method to try is password. : Trying password authentication. : Login completed, opening dummy shell channel. : channel 0: new [client-session] : Requesting channel_open for channel 0. : channel 0: open confirm rwindow 1024 rmax 4096 : Got channel open confirmation, requesting shell. : Requesting service shell on channel 0. : channel 1: new [client-session] : Requesting channel_open for channel 1. : Entering interactive session. : Channel open failure: 1: reason 4: : channel 2: new [client-session] : Requesting channel_open for channel 2. : Entering interactive session. : Channel open failure: 2: reason 4: I tried with the $suppress_shell option turned on, my function call reads: $ssh->login($user,$pass,1); It resulted in: #./ciscoprobe.pl : Reading configuration data /root/.ssh/config : Reading configuration data /etc/ssh_config : Connecting to XXX.XXX.XXX.XXX, port 22. : Remote protocol version 2.0, remote software version Cisco-1.25 : Net::SSH::Perl Version 1.34, protocol version 2.0. : No compat match: Cisco-1.25. : Connection established. : Sent key-exchange init (KEXINIT), wait response. : Algorithms, c->s: 3des-cbc hmac-sha1 none : Algorithms, s->c: 3des-cbc hmac-sha1 none : Entering Diffie-Hellman Group 1 key exchange. : Sent DH public key, waiting for reply. : Received host key, type 'ssh-rsa'. : Host 'XXX.XXX.XXX.XXX' is known and matches the host key. : Computing shared secret key. : Verifying server signature. : Waiting for NEWKEYS message. : Send NEWKEYS. : Enabling encryption/MAC/compression. : Sending request for user-authentication service. : Service accepted: ssh-userauth. : Trying empty user-authentication request. : Authentication methods that can continue: keyboard-interactive,password. : Next method to try is password. : Trying password authentication. : Login completed, opening dummy shell channel. : channel 0: new [client-session] : Requesting channel_open for channel 0. : channel 0: open confirm rwindow 1024 rmax 4096 : channel 1: new [client-session] : Requesting channel_open for channel 1. : Entering interactive session. : Channel open failure: 1: reason 4: : channel 2: new [client-session] : Requesting channel_open for channel 2. : Entering interactive session. : Channel open failure: 2: reason 4: I hoped that the above and/or the advice in http://cpanforum.com/threads/851 would have helped me but I have not managed to make any progress. What I am unsure about the cpanforum advice, is just which lines to remove that comprise 'sub login -> removed the code to open a "dummy channel"' I also wonder how valid the advice is, because the thread was updated in 2006! If anyone has any ideas about what my problem could be or how valid the advice on the cpanforum forum, please could they let me know. Thanks in advance, Richard. The Logic Group Enterprises Limited. Logic House, Waterfront Business Park, Fleet Road, Fleet, Hampshire, GU51 3SB, United Kingdom. Registered in England. Registered No. 2609323 The information in this email and any attachments are confidential and may be legally privileged and protected by law. It is for the intended recipient only. If you are not the intended recipient you may not use, disclose, copy, distribute, print or rely on the content of this email or its attachments. If this email has been received by you in error please advise the sender and delete the email from your computer. -----Original Message----- From: Richard Thomas Sent: 24 August 2010 08:54 To: 'ssh...@li...'; 'Jeremy Kitchen' Subject: RE: [Ssh-sftp-perl-users] SSH2 support for Net::SSH::Perl Hi Jeremy, Thank you very much for pointing me in the right direction, it's amazing how simple it is to get past that issue! I will now be following the advice in the following article, as I'm getting the "Channel open failure: 1: reason 4:" error: http://cpanforum.com/threads/851 Thanks again, Richard. -----Original Message----- From: Jeremy Kitchen [mailto:ki...@sc...] Sent: 24 August 2010 01:17 To: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] SSH2 support for Net::SSH::Perl On Aug 23, 2010, at 8:34 AM, Richard Thomas wrote: > Key class 'Net::SSH::Perl::Key::RSA' is unsupported: Base class package "Class::ErrorHandler" is empty. > (Perhaps you need to 'use' the module which defines that package first.) > at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5 > BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5, <GEN0> line 1. > Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. > BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. > Compilation failed in require at (eval 37) line 1, <GEN0> line 1. > BEGIN failed--compilation aborted at (eval 37) line 1, <GEN0> line 1. > > > So I added "use Net::SSH::Perl::Key::RSA;" to my script and I got: > > #./ciscoprobe.pl > Base class package "Class::ErrorHandler" is empty. > #./ciscoprobe.pl > Can't locate Class/ErrorHandler.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./ciscoprobe.pl line 16. > BEGIN failed--compilation aborted at ./ciscoprobe.pl line 16. install Class::ErrorHandler -Jeremy ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Richard T. <Ric...@th...> - 2010-08-24 07:54:12
|
Hi Jeremy, Thank you very much for pointing me in the right direction, it's amazing how simple it is to get past that issue! I will now be following the advice in the following article, as I'm getting the "Channel open failure: 1: reason 4:" error: http://cpanforum.com/threads/851 Thanks again, Richard. The Logic Group Enterprises Limited. Logic House, Waterfront Business Park, Fleet Road, Fleet, Hampshire, GU51 3SB, United Kingdom. Registered in England. Registered No. 2609323 The information in this email and any attachments are confidential and may be legally privileged and protected by law. It is for the intended recipient only. If you are not the intended recipient you may not use, disclose, copy, distribute, print or rely on the content of this email or its attachments. If this email has been received by you in error please advise the sender and delete the email from your computer. -----Original Message----- From: Jeremy Kitchen [mailto:ki...@sc...] Sent: 24 August 2010 01:17 To: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] SSH2 support for Net::SSH::Perl On Aug 23, 2010, at 8:34 AM, Richard Thomas wrote: > Key class 'Net::SSH::Perl::Key::RSA' is unsupported: Base class package "Class::ErrorHandler" is empty. > (Perhaps you need to 'use' the module which defines that package first.) > at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5 > BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5, <GEN0> line 1. > Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. > BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. > Compilation failed in require at (eval 37) line 1, <GEN0> line 1. > BEGIN failed--compilation aborted at (eval 37) line 1, <GEN0> line 1. > > > So I added "use Net::SSH::Perl::Key::RSA;" to my script and I got: > > #./ciscoprobe.pl > Base class package "Class::ErrorHandler" is empty. > #./ciscoprobe.pl > Can't locate Class/ErrorHandler.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./ciscoprobe.pl line 16. > BEGIN failed--compilation aborted at ./ciscoprobe.pl line 16. install Class::ErrorHandler -Jeremy ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Jeremy K. <ki...@sc...> - 2010-08-24 00:33:34
|
On Aug 23, 2010, at 8:34 AM, Richard Thomas wrote: > Key class 'Net::SSH::Perl::Key::RSA' is unsupported: Base class package "Class::ErrorHandler" is empty. > (Perhaps you need to 'use' the module which defines that package first.) > at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5 > BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5, <GEN0> line 1. > Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. > BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. > Compilation failed in require at (eval 37) line 1, <GEN0> line 1. > BEGIN failed--compilation aborted at (eval 37) line 1, <GEN0> line 1. > > > So I added "use Net::SSH::Perl::Key::RSA;" to my script and I got: > > #./ciscoprobe.pl > Base class package "Class::ErrorHandler" is empty. > #./ciscoprobe.pl > Can't locate Class/ErrorHandler.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./ciscoprobe.pl line 16. > BEGIN failed--compilation aborted at ./ciscoprobe.pl line 16. install Class::ErrorHandler -Jeremy |
From: Richard T. <Ric...@th...> - 2010-08-23 16:09:06
|
Hi, Does anyone know why I am getting a problem with SSH2 please? I have been running a script to connect to an SSH1 device and it's stopped working since the device has been upgraded to SSH2. I have version 1.34 of Net::SSH::Perl, So I changed my "new" line of code to the following: my $ssh = Net::SSH::Perl->new($hostip, privileged => 0, protocol => 2, debug => 1); What I get when I run it like that is: #./ciscoprobe.pl : Reading configuration data /root/.ssh/config : Reading configuration data /etc/ssh_config : Connecting to 80.40.141.19, port 22. : Remote protocol version 2.0, remote software version Cisco-1.25 : Net::SSH::Perl Version 1.34, protocol version 2.0. : No compat match: Cisco-1.25. : Connection established. : Sent key-exchange init (KEXINIT), wait response. : Algorithms, c->s: 3des-cbc hmac-sha1 none : Algorithms, s->c: 3des-cbc hmac-sha1 none : Entering Diffie-Hellman Group 1 key exchange. : Sent DH public key, waiting for reply. Key class 'Net::SSH::Perl::Key::RSA' is unsupported: Base class package "Class::ErrorHandler" is empty. (Perhaps you need to 'use' the module which defines that package first.) at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5 BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5, <GEN0> line 1. Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21, <GEN0> line 1. Compilation failed in require at (eval 37) line 1, <GEN0> line 1. BEGIN failed--compilation aborted at (eval 37) line 1, <GEN0> line 1. So I added "use Net::SSH::Perl::Key::RSA;" to my script and I got: #./ciscoprobe.pl Base class package "Class::ErrorHandler" is empty. (Perhaps you need to 'use' the module which defines that package first.) at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5 BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5. Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21. Compilation failed in require at ./ciscoprobe.pl line 18. BEGIN failed--compilation aborted at ./ciscoprobe.pl line 18. I then added "use Class::ErrorHandler;" to my script and I got: #./ciscoprobe.pl Can't locate Class/ErrorHandler.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./ciscoprobe.pl line 16. BEGIN failed--compilation aborted at ./ciscoprobe.pl line 16. Please could you let me know if there is anything you can think of that I can do to get this working to our SSH2 devices. Thanks in advance. Richard. Click here<http://the-logic-group-news.com/7O0-3I9/s.aspx> to register for our whitepaper on new approaches to PCI DSS, end-to-end encryption and tokenisation. New secure payment solutions from The Logic Group that help reduce the data considered in scope and the cost of compliance. [http://www.the-logic-group.com/CP/UploadedImages/75bd388c-1f27-41f4-8f68-adf034d0b2ea.jpg] <http://www.the-logic-group.com/CP/UploadedImages/75bd388c-1f27-41f4-8f68-adf034d0b2ea.jpg> The Logic Group Enterprises Limited, Logic House, Waterfront Business Park, Fleet Road, Fleet, Hampshire, GU51 3SB, United Kingdom. Registered in England. Registered No. 2609323 The information in this email and any attachments are confidential and may be legally privileged and protected by law. It is for the intended recipient only. If you are not the intended recipient you may not use, disclose, copy, distribute, print or rely on the content of this email or its attachments. If this email has been received by you in error please advise the sender and delete the email from your system. |
From: Ashok <ash...@gm...> - 2010-08-20 05:15:58
|
Hi Consider I am having 3 linux machine(A, B, C). In which I want to execute the perl program in machine A. Then in that program I have to do an ssh to machine B(first login) and i have to executed some commands in machine B. Then I have to executed ssh from machine B to machine C(second login). then I have to executed some command in machine c. How to achieve this in perl. Note : I can login to machine C only from machine B. I can execute perl program only in machine A. Regards, (`'•.¸(`'•.¸ ¸.•'´) ¸.•'´) ~/\~$~|-|~( )~|<~ (¸.•'´(¸.•'´ `'•.¸)`' •.¸) |
From: Salvador F. <sfa...@ya...> - 2010-07-21 16:47:42
|
----- Original Message ---- > From: Bob Gammage <sta...@ga...> > To: ssh...@li... > Cc: Salvador Fandino <sfa...@ya...> > Sent: Wed, July 21, 2010 4:41:56 PM > Subject: Re: [Ssh-sftp-perl-users] Getting SETSTAT failures from sftp-put >SOLVED > > Salva, > Everything I'd previously read suggested using Compat so the local >implementation of OpenSSH would be used instead of the perl-implementation. >The logic being that OpenSSH is more rigorously kept patched with security >updates. it seems you are confused! There are mainly two Perl modules implementing the SFTP protocol: Net::SFTP that runs on top of Net::SSH::Perl and Net::SFTP::Foreign that uses a binary SSH client to establish the SSH connection to the server. Net::SFTP::Foreign::Compact is a thin adapter layer on top of Net::SFTP::Foreign implementing (most of) the API of Net::SFTP, so that programs written for this module can be easily be changed to use Net::SFTP::Foreign. ... well, actually, there is a third module implementing SFTP in Perl, Net::SSH2::SFTP, distributed as part of Net::SSH2, but it is not very powerful yet, lacking some indispensable features as "put" and "get" methods. - Salva > Your suggested change to the 'new' and 'put' arguments does indeed seem to >work on the new host and seems to work just fine with all the others as well. > > Thank you very very much. > -- Bob > Si vis pacem, para bellum > > Salva wrote: > > You will have to switch to the real thing and use Net::SFTP::Foreign in >order to solve your problem: > > > > $sftp = Net::SFTP::Foreign->new($RHNAME, user => $RHUSER, port => >$RHPORT); > > $sftp->put($SAF, $DAF, copy_perms => 0, copy_time => 0); > > > > Cheers, > > - Salva > > > > > > > ----- Original Message ---- > >> From: Bob To: ssh...@li... > >> Sent: Wed, July 21, 2010 2:20:54 PM > >> Subject: [Ssh-sftp-perl-users] Getting SETSTAT failures from sftp-put > >> > >> Dear perl-gods, > >> I have a daemon, written in perl, that SFTP's files to target hosts > >> based upon an INI file of local-directories to watch, and target-hosts. > >> It has been working fine for some time. > >> > >> I am using Perl v5.8.8, Net::SFTP::Foreign v1.51 & ::Compat v1.36 > >> > >> The relevant code is: > >> %LIBARGS=('user'+>$RHUSER,'port'=>$RHPORT,'late_setperm'=>1); > >> $SLC = Net::SFTP::Foreign::Compat->new($RHNAME, %LIBARGS); > >> my $FXSTAT = $SLC->put($SAF, $DAF); > >> > >> A new host to which I must now send things is a relatively new SFTP > >> implementation and has internal processes that move files as soon as > >> received. I suspect this is the reason I am getting an error: > >> "Couldn't setstat remote file (setstat)': Specified file path is invalid" > >> ...even though the file was received by the remote host. > >> > >> This new host also does not permit changing perms on open files so the > >> "late_setperm" argument must be used (as is required on all my other >hosts). > >> Given a choice between error 3 "The requested operation cannot be > >> performed because there is a file transfer in progress" or error 2 > >> "Specified file path is invalid", I've opted to put in a workaround (the > >> logic handling $FXSTAT values) to disregard error 2 from this particular > >> host. > >> I'd prefer eliminating the error. > >> > >> I am not talented enough to interpret all that is going on in > >> Net/SFTP/Foreign/Compat.pm > >> but I believe it is setting permissions and such, whether that is needed > >> or not, and this is what is actually failing. > >> I absolutely do NOT want to modify Compat.pm or any other parts of the > >> module, for a variety of reasons. > >> I am hoping there is some option to disable the setting of attributes. > > > > > > |
From: Howard, C. <Ho...@pr...> - 2010-07-21 16:06:49
|
This may be an unhelpful response: It seems to me that you need more handshaking between the two systems to coordinate when the file has safely and completely arrived; either the file is in process or it has already been whisked away. Why not use sftp to send the file to an innocuous place or filename, get the permissions all set, then rename the file to be picked up by the second system's processes? If it has to be so tightly coupled, then maybe go to a web service or remote procedure call or other method of coordination. I expect I'm not really answering your question. > -----Original Message----- > From: Bob Gammage [mailto:sta...@ga...] > Sent: Wednesday, July 21, 2010 6:21 AM > To: ssh...@li... > Subject: [Ssh-sftp-perl-users] Getting SETSTAT failures from sftp-put > > Dear perl-gods, > I have a daemon, written in perl, that SFTP's files to target hosts > based upon an INI file of local-directories to watch, and target-hosts. > It has been working fine for some time. > > I am using Perl v5.8.8, Net::SFTP::Foreign v1.51 & ::Compat v1.36 > > The relevant code is: > %LIBARGS=('user'+>$RHUSER,'port'=>$RHPORT,'late_setperm'=>1); > $SLC = Net::SFTP::Foreign::Compat->new($RHNAME, %LIBARGS); > my $FXSTAT = $SLC->put($SAF, $DAF); > > A new host to which I must now send things is a relatively new SFTP > implementation and has internal processes that move files as soon as > received. I suspect this is the reason I am getting an error: > "Couldn't setstat remote file (setstat)': Specified file path is > invalid" > ...even though the file was received by the remote host. > > This new host also does not permit changing perms on open files so the > "late_setperm" argument must be used (as is required on all my other > hosts). > Given a choice between error 3 "The requested operation cannot be > performed because there is a file transfer in progress" or error 2 > "Specified file path is invalid", I've opted to put in a workaround > (the > logic handling $FXSTAT values) to disregard error 2 from this > particular > host. > I'd prefer eliminating the error. > > I am not talented enough to interpret all that is going on in > Net/SFTP/Foreign/Compat.pm > but I believe it is setting permissions and such, whether that is > needed > or not, and this is what is actually failing. > I absolutely do NOT want to modify Compat.pm or any other parts of the > module, for a variety of reasons. > I am hoping there is some option to disable the setting of attributes. > > Thanks for any help with this. > > -- > RLG, That's me. > Si vis pacem, para bellum > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Bob G. <sta...@ga...> - 2010-07-21 14:43:24
|
Salva, Everything I'd previously read suggested using Compat so the local implementation of OpenSSH would be used instead of the perl-implementation. The logic being that OpenSSH is more rigorously kept patched with security updates. Your suggested change to the 'new' and 'put' arguments does indeed seem to work on the new host and seems to work just fine with all the others as well. Thank you very very much. -- Bob Si vis pacem, para bellum Salva wrote: > You will have to switch to the real thing and use Net::SFTP::Foreign in order to > solve your problem: > > $sftp = Net::SFTP::Foreign->new($RHNAME, user => $RHUSER, port => $RHPORT); > $sftp->put($SAF, $DAF, copy_perms => 0, copy_time => 0); > > Cheers, > - Salva > > > > ----- Original Message ---- >> From: Bob >> To: ssh...@li... >> Sent: Wed, July 21, 2010 2:20:54 PM >> Subject: [Ssh-sftp-perl-users] Getting SETSTAT failures from sftp-put >> >> Dear perl-gods, >> I have a daemon, written in perl, that SFTP's files to target hosts >> based upon an INI file of local-directories to watch, and target-hosts. >> It has been working fine for some time. >> >> I am using Perl v5.8.8, Net::SFTP::Foreign v1.51 & ::Compat v1.36 >> >> The relevant code is: >> %LIBARGS=('user'+>$RHUSER,'port'=>$RHPORT,'late_setperm'=>1); >> $SLC = Net::SFTP::Foreign::Compat->new($RHNAME, %LIBARGS); >> my $FXSTAT = $SLC->put($SAF, $DAF); >> >> A new host to which I must now send things is a relatively new SFTP >> implementation and has internal processes that move files as soon as >> received. I suspect this is the reason I am getting an error: >> "Couldn't setstat remote file (setstat)': Specified file path is invalid" >> ...even though the file was received by the remote host. >> >> This new host also does not permit changing perms on open files so the >> "late_setperm" argument must be used (as is required on all my other hosts). >> Given a choice between error 3 "The requested operation cannot be >> performed because there is a file transfer in progress" or error 2 >> "Specified file path is invalid", I've opted to put in a workaround (the >> logic handling $FXSTAT values) to disregard error 2 from this particular >> host. >> I'd prefer eliminating the error. >> >> I am not talented enough to interpret all that is going on in >> Net/SFTP/Foreign/Compat.pm >> but I believe it is setting permissions and such, whether that is needed >> or not, and this is what is actually failing. >> I absolutely do NOT want to modify Compat.pm or any other parts of the >> module, for a variety of reasons. >> I am hoping there is some option to disable the setting of attributes. > |
From: Bob G. <sta...@ga...> - 2010-07-21 12:21:01
|
Dear perl-gods, I have a daemon, written in perl, that SFTP's files to target hosts based upon an INI file of local-directories to watch, and target-hosts. It has been working fine for some time. I am using Perl v5.8.8, Net::SFTP::Foreign v1.51 & ::Compat v1.36 The relevant code is: %LIBARGS=('user'+>$RHUSER,'port'=>$RHPORT,'late_setperm'=>1); $SLC = Net::SFTP::Foreign::Compat->new($RHNAME, %LIBARGS); my $FXSTAT = $SLC->put($SAF, $DAF); A new host to which I must now send things is a relatively new SFTP implementation and has internal processes that move files as soon as received. I suspect this is the reason I am getting an error: "Couldn't setstat remote file (setstat)': Specified file path is invalid" ...even though the file was received by the remote host. This new host also does not permit changing perms on open files so the "late_setperm" argument must be used (as is required on all my other hosts). Given a choice between error 3 "The requested operation cannot be performed because there is a file transfer in progress" or error 2 "Specified file path is invalid", I've opted to put in a workaround (the logic handling $FXSTAT values) to disregard error 2 from this particular host. I'd prefer eliminating the error. I am not talented enough to interpret all that is going on in Net/SFTP/Foreign/Compat.pm but I believe it is setting permissions and such, whether that is needed or not, and this is what is actually failing. I absolutely do NOT want to modify Compat.pm or any other parts of the module, for a variety of reasons. I am hoping there is some option to disable the setting of attributes. Thanks for any help with this. -- RLG, That's me. Si vis pacem, para bellum |
From: Thierry C. <thi...@gm...> - 2010-07-13 21:29:05
|
Hello, I don't know what do you want to do exactly, but you have to know that the version 0.09 is now a very old one. And Net::SSH::Perl is very difficult to compile, specially on Windows plateform. You should consider to find a precompiled version (a ppm for instance). Regards, Thierry Le 13 juil. 2010 à 22:19, "Lucas, Glenn" <Gle...@te...> a écrit : > In the README file, the Net::SSH::Perl library lists the following > steps: > > To install: > > perl Makefile.PL > > make > > make test # nothing substantial yet > > make install > > > > On the second step of the four step build process, I get the > following error: > > C:\PerlSSH\Net-SSH-0.09>make > > > > OPUS MAKE Version 6.10 for Windows NT (PM/CB emulation) > > Copyright OPUS Software. All rights reserved. > > > > OPUS MAKE: Don't know how to make 'C:\Perl\libConfig.pm'. Stop. > > > > Any ideas on how I create a libConfig.pm? > > > > Thanks, > > Glenn Lucas > > > > --- > --- > --- > --------------------------------------------------------------------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Lucas, G. <Gle...@te...> - 2010-07-13 20:32:09
|
In the README file, the Net::SSH::Perl library lists the following steps: To install: perl Makefile.PL make make test # nothing substantial yet make install On the second step of the four step build process, I get the following error: C:\PerlSSH\Net-SSH-0.09>make OPUS MAKE Version 6.10 for Windows NT (PM/CB emulation) Copyright OPUS Software. All rights reserved. OPUS MAKE: Don't know how to make 'C:\Perl\libConfig.pm'. Stop. Any ideas on how I create a libConfig.pm? Thanks, Glenn Lucas |
From: Min L. <ml...@ff...> - 2010-05-27 21:37:23
|
I was able to use Net::SFTP to connect to a server and also print the files in the directory. However, I have problem downloading the file using 'get'. I specified the local file name but it was not created by running the script. Instead, a file with the same name as the remote file (my $file = 'remote_file_name.txt') was created but it is not readable. use Net::SFTP; my %args = ( user => $user, password => $passw, debug=>1); my $sftp = Net::SFTP->new($host, %args); my $file = 'remote_file_name.txt'; my $string = $sftp->get("./$file", 'local_file_name.txt');# or die "unable to download file\n"; Debugging message from the module doesn't help too much: sftp: Sent message T:17 I:0 sftp: Received stat reply T:105 I:0 sftp: Sent SSH2_FXP_OPEN I:1 P:./ remote_file_name.txt sftp: Sent message SSH2_FXP_READ I:2 O:0 sftp: Received reply T:101 I:2 sftp: Sent message T:4 I:3 Thanks in advance for help. ________________________________ This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you are notified that reviewing, disseminating, disclosing, copying or distributing this e-mail is strictly prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any loss or damage caused by viruses or errors or omissions in the contents of this message, which arise as a result of e-mail transmission. [FriendFinder Networks, Inc., 220 Humbolt court, Sunnyvale, CA 94089, USA, FriendFinder.com |
From: Ron S. <gee...@ya...> - 2010-05-26 04:44:23
|
http://cevasome.t35.com/ |
From: Alexander S. <ale...@cb...> - 2010-05-07 17:13:10
|
Merci beaucoup, Thierry! That works like a charm! Kind regards Alexander -----Original Message----- From: Thierry CHICH [mailto:thi...@ac...] Sent: 07 May 2010 18:44 To: ssh...@li... Cc: Alexander Schwab Subject: Re: [Ssh-sftp-perl-users] Problem login in to Cisco ASA 7.2(2) with Net::SSH::Perl Hello, When I have tried with pix, I have to use a pipe ie I emit my comands on the standard input, like this : use Net::SSH::Perl; use Term::ReadKey; my $cmd=" ena ocsic conf t pager 0 sh conn "; my $host="192.168.0.1"; my $user="pix"; my $pass="mypass"; my $ssh = Net::SSH::Perl->new($host,debug=>true, options => ["BatchMode yes", "RhostsAuthentication no" ]); $ssh->login($user,$pass); my ($stdout, $stderr, $exit) = $ssh->cmd("",$cmd); print "stdout:$stdout \n"; print "stderr: $stderr \n"; print "$exit\n"; Le vendredi 7 mai 2010 13:10:58, Alexander Schwab a écrit : > Hello, > > I have a problem login in to a Cisco ASA 7.2(2) via Net::SSH::Perl. I > tried both SSH protocols 1 and 2 but both attempts fail. Login in to > Cisco Switches is no problem at all, but this ASA seems to do things > differently. I want to avoid setting up a bidirectional pipe in perl > to an SSH client to get some config data out of my firewall. > > Can anyone point me into the right direction? I appended the script, > and the debug output of the firewall and perl script, both for SSH > protocol > 1 and 2. > > Your help would be greatly appreciated. > Thanks in advance. > > Regards > Alexander > > > Here is my little perl script: > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > > #!/usr/bin/perl -w > > use Net::SSH::Perl; > > my $host = "f1p100fws.seydler.local"; > my $user = "admin"; > my $pw = "mytoughpw"; > my $enablepw = "mytoughenablepw"; > > my $ssh = Net::SSH::Perl->new($host, %params => ("debug", "true", > "protocol", "1 ,2")); $ssh->login($user, $pw); > > my($stdout, $stderr, $exit) = $ssh->cmd("show version"); > > print $stdout; > print $stderr; > print $exit; > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > > Here is the debugging output of both the perl module and the ASA using > SSH protocol 1: > > f1p100fws# debug ssh 10 > debug ssh enabled at level 10 > f1p100fws# Device ssh opened successfully. > SSH2: SSH client: IP = 'f1s608wws' interface # = 47 > SSH: host key initialised > SSH2: starting SSH control process > SSH2: Exchanging versions - SSH-1.99-Cisco-1.25 > > SSH2: send SSH message: outdata is NULL > > server version string:SSH-1.99-Cisco-1.25SSH2: receive SSH message: 83 > (83) > SSH2: client version is - SSH-1.5-1.34 > > client version string:SSH-1.5-1.34SSH2: begin server key generation > SSH2: complete server key generation, elapsed time = 870 ms > SSH2: declare what cipher(s) we support: > 00 0x00 0x00 0x0c 0xSSH2: send SSH message: SSH_SMSG_PUBLIC_KEY > (2) > SSH2: SSH_SMSG_PUBLIC_KEY message sent > SSH2: receive SSH message: SSH_CMSG_SESSION_KEY (3) > SSH2: SSH_CMSG_SESSION_KEY message received - msg type 0x03, length > 144 > SSH2: client requests 3DES cipher: 3 > SSH: scb created 0x6a25288, size 104 > SSH2: send SSH message: SSH_SMSG_SUCCESS (14) > SSH2: keys exchanged and encryption on > SSH2: receive SSH message: SSH_CMSG_USER (4) > SSH2: authentication request for userid admin > SSH(admin): user authen method is 'use AAA', aaa server group ID = 1 > SSH2: send SSH message: SSH_SMSG_FAILURE (15) > SSH2: receive SSH message: SSH_CMSG_AUTH_PASSWORD (9) > SSH2: send SSH message: SSH_SMSG_SUCCESS (14) > SSH2: authentication successful for admin > SSH2: receive SSH message: SSH_CMSG_EXEC_CMD (13) > SSH2: starting exec shell > > And here is the debugging output of my script: > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > > aschwab@f1s608wws$ ./sshfw.pl > Name "main::params" used only once: possible typo at ./sshfw.pl line 10. > f1s608wws: Reading configuration data /home/aschwab/.ssh/config > f1s608wws: Reading configuration data /etc/ssh_config > f1s608wws: Connecting to f1p100fws.seydler.local, port 22. > f1s608wws: Remote protocol version 1.99, remote software version > Cisco-1.25 > f1s608wws: Net::SSH::Perl Version 1.34, protocol version 1.5. > f1s608wws: No compat match: Cisco-1.25. > f1s608wws: Connection established. > f1s608wws: Waiting for server public key. > f1s608wws: Received server public key (768 bits) and host key (1024 > bits). > f1s608wws: Host 'f1p100fws.seydler.local' is known and matches the > host key. > f1s608wws: Encryption type: DES3 > f1s608wws: Sent encrypted session key. > f1s608wws: Received encryption confirmation. > f1s608wws: Trying password authentication. > f1s608wws: Sending command: show version > f1s608wws: Entering interactive session. > > The script hangs afterwards and must be terminated with CTRL-C. > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > > Here is the debugging output when using SSH protocol version 2: > > aschwab@f1s608wws$ ./sshfw.pl > Name "main::params" used only once: possible typo at ./sshfw.pl line 10. > f1s608wws: Reading configuration data /home/aschwab/.ssh/config > f1s608wws: Reading configuration data /etc/ssh_config > f1s608wws: Connecting to f1p100fws.seydler.local, port 22. > f1s608wws: Remote protocol version 1.99, remote software version > Cisco-1.25 > f1s608wws: Net::SSH::Perl Version 1.34, protocol version 2.0. > f1s608wws: No compat match: Cisco-1.25. > f1s608wws: Connection established. > f1s608wws: Sent key-exchange init (KEXINIT), wait response. > f1s608wws: Algorithms, c->s: 3des-cbc hmac-sha1 none > f1s608wws: Algorithms, s->c: 3des-cbc hmac-sha1 none > f1s608wws: Entering Diffie-Hellman Group 1 key exchange. > f1s608wws: Sent DH public key, waiting for reply. > f1s608wws: Received host key, type 'ssh-rsa'. > f1s608wws: Host 'f1p100fws.seydler.local' is known and matches the > host key. > f1s608wws: Computing shared secret key. > f1s608wws: Verifying server signature. > f1s608wws: Waiting for NEWKEYS message. > f1s608wws: Send NEWKEYS. > f1s608wws: Enabling encryption/MAC/compression. > f1s608wws: Sending request for user-authentication service. > f1s608wws: Service accepted: ssh-userauth. > f1s608wws: Trying empty user-authentication request. > f1s608wws: Authentication methods that can continue: password. > f1s608wws: Next method to try is password. > f1s608wws: Trying password authentication. > f1s608wws: Login completed, opening dummy shell channel. > f1s608wws: channel 0: new [client-session] > f1s608wws: Requesting channel_open for channel 0. > f1s608wws: channel 0: open confirm rwindow 1024 rmax 4096 > f1s608wws: Got channel open confirmation, requesting shell. > f1s608wws: Requesting service shell on channel 0. > f1s608wws: channel 1: new [client-session] > f1s608wws: Requesting channel_open for channel 1. > f1s608wws: Entering interactive session. > f1s608wws: Channel open failure: 1: reason 4: > Use of uninitialized value $stdout in print at ./sshfw.pl line 15. > Use of uninitialized value $stderr in print at ./sshfw.pl line 16. > Use of uninitialized value $exit in print at ./sshfw.pl line 17. > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > > SSH2: SSH client: IP = 'f1s608wws' interface # = 47 > SSH: host key initialised > SSH2: starting SSH control process > SSH2: Exchanging versions - SSH-1.99-Cisco-1.25 > > SSH2: send SSH message: outdata is NULL > > server version string:SSH-1.99-Cisco-1.25SSH2: receive SSH message: 83 > (83) > SSH2: client version is - SSH-2.0-1.34 > > client version string:SSH-2.0-1.34SSH2: begin server key generation > SSH2: complete server key generation, elapsed time = 590 ms > > SSH2 2: SSH2_MSG_KEXINIT sent > SSH2 2: SSH2_MSG_KEXINIT received > SSH2 0: > kex_parse_kexinit: diffie-hellman-group1-sha1 > SSH2 0: > kex_parse_kexinit: ssh-rsa > SSH2 0: > kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc > SSH2 0: > kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc > SSH2 0: > kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 > SSH2 0: > kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 > SSH2 0: > kex_parse_kexinit: none > SSH2 0: > kex_parse_kexinit: none > SSH2 0: > kex_parse_kexinit: > SSH2 0: > kex_parse_kexinit: > SSH2 0: > kex_parse_kexinit: diffie-hellman-group1-sha1 > SSH2 0: > kex_parse_kexinit: ssh-dss,ssh-rsa > SSH2 0: > kex_parse_kexinit: 3des-cbc,blowfish-cbc,arcfour > SSH2 0: > kex_parse_kexinit: 3des-cbc,blowfish-cbc,arcfour > SSH2 0: > kex_parse_kexinit: hmac-sha1,hmac-md5 > SSH2 0: > kex_parse_kexinit: hmac-sha1,hmac-md5 > SSH2 0: > kex_parse_kexinit: none > SSH2 0: > kex_parse_kexinit: none > SSH2 0: > kex_parse_kexinit: > SSH2 0: > kex_parse_kexinit: > SSH2: kex: client->server 3des-cbc hmac-sha1 none > SSH2: kex: server->client 3des-cbc hmac-sha1 none > SSH2 2: expecting SSH2_MSG_KEXDH_INIT > SSH2 2: SSH2_MSG_KEXDH_INIT received > dh_client_pub= > 5f66c97d45ab2580 412f0723c66cda07 1dabeac438b57856 8bb1a882bc8cfd18 > 98fd5c5adb1028f3 260af0c8f8b1d177 e4efa8854fc75b2c 1adcc1e6f9ec0988 > ffe55b019da9b213 9f3ad9490321fb4a 91bd6d371d893953 ce226c96fae42d65 > ea22deeb943e725f fa4179d746d12c84 8907bd37c0c10b44 715071a947e16ceb > > > my_dh_pub= > 57f24f069c303207 7f86a571d04ff508 3371b6942660117d 0b61ef155f87e47f > 3360e5c10ee66cdf 5ee5ed3f36464379 51a08c796faa0ebc 9ca50b312ad54193 > c613ab2484e57f36 37d1b56dab99c55b 4637457647822e6a b4733b2bf0904211 > a0e5d8e2fb2f19b2 f4b766455dd4b4eb 655e750e50919ae3 bac3e59dc7dfdaed > > > shared secret > 31d99dc902d1ff2f f087ce0d4edeb480 dd9cf5ed8523448a 99f31d40d622c0de > 60aea956ae2aab04 22a4950bd5c2ec5d 78f283c9e76ae978 397e476e71d6a9bb > 8f515d90d0a11ef9 4240d62e22f2147a 41f98cf1d6f88157 bd61f437b727111c > 80ee2f855f3a8216 febcd7ae6434b1da 400fdf264f445f26 e91e7af77657a159 > > > hash > a0b558d46a410bcd 1f7f72ca8ea43465 240632c8 > > SSH2 2: signature length 143 > signature > > 000000077373682d 727361000000801e e24116b92091541c 9c7ab0cdac90f525 > 0e45fbaaf863b39a bc7b66679823d1e3 6af87f2075c17da8 97eb267814af5a9b > 6d3bd98bc6102e36 5eea2bac94998772 7a9dd1a8e1406cad f15dae317c2284e8 > 5255b67bc31a4733 817ee208b7a942fe 39f418e7857468c4 fb6cdbb86f9814ce > c8aab2acc297d2e1 02d8b11bb919c3 > > key > 2b672ec8618dd4d7 45bce80e215ad230 972a957666632cf7 > > key = A > 2b672ec8618dd4d7 45bce80e215ad230 972a957666632cf7 > > key > 7bd9e5a4e4be24d4 407d856ff37b0d1f 4ad1d874d0d28d95 > > key = B > 7bd9e5a4e4be24d4 407d856ff37b0d1f 4ad1d874d0d28d95 > > key > 70301fa848d6737c 3a27327cd39620fa 1cda94fc1d33b147 > > key = C > 70301fa848d6737c 3a27327cd39620fa 1cda94fc1d33b147 > > key > 3c14840b8c51d063 866029aa13748e71 4a84d8baa0c2a552 > > key = D > 3c14840b8c51d063 866029aa13748e71 4a84d8baa0c2a552 > > key > 93a6cf893e92d6b6 83542f8646024c84 98ce8ba0ce1ae316 > > key = E > 93a6cf893e92d6b6 83542f8646024c84 98ce8ba0ce1ae316 > > key > 069b66f62d12bb56 dc4084722b7ef3c3 58cf5dbc0bc94d51 > > key = F > 069b66f62d12bb56 dc4084722b7ef3c3 58cf5dbc0bc94d51 > > SSH2: kex_derive_keys complete > SSH2 2: newkeys: mode 1 > SSH2 2: SSH2_MSG_NEWKEYS sent > SSH2 2: waiting for SSH2_MSG_NEWKEYS > SSH2 2: newkeys: mode 0 > SSH2 2: SSH2_MSG_NEWKEYS receivedSSH(admin): user authen method is > 'use AAA', aaa server group ID = 1 > SSH(admin): user authen method is 'use AAA', aaa server group ID = 1 > > SSH2 2: authentication successful for admin > SSH2 2: channel open request > SSH2 2: shell request > SSH2 2: shell message receivedSSH2: TCP read failed, error code = > 0x86300003 "TCP connection closed" > SSH2: receive SSH message: [no message ID: variable *data is NULL] > SSH2: Session disconnected by SSH server - error 0x00 "Internal error" > > ---------------------------------------------------------------------- > ----- > --- > > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Alexander S. <ale...@cb...> - 2010-05-07 11:27:19
|
Hello, I have a problem login in to a Cisco ASA 7.2(2) via Net::SSH::Perl. I tried both SSH protocols 1 and 2 but both attempts fail. Login in to Cisco Switches is no problem at all, but this ASA seems to do things differently. I want to avoid setting up a bidirectional pipe in perl to an SSH client to get some config data out of my firewall. Can anyone point me into the right direction? I appended the script, and the debug output of the firewall and perl script, both for SSH protocol 1 and 2. Your help would be greatly appreciated. Thanks in advance. Regards Alexander Here is my little perl script: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ #!/usr/bin/perl -w use Net::SSH::Perl; my $host = "f1p100fws.seydler.local"; my $user = "admin"; my $pw = "mytoughpw"; my $enablepw = "mytoughenablepw"; my $ssh = Net::SSH::Perl->new($host, %params => ("debug", "true", "protocol", "1 ,2")); $ssh->login($user, $pw); my($stdout, $stderr, $exit) = $ssh->cmd("show version"); print $stdout; print $stderr; print $exit; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ Here is the debugging output of both the perl module and the ASA using SSH protocol 1: f1p100fws# debug ssh 10 debug ssh enabled at level 10 f1p100fws# Device ssh opened successfully. SSH2: SSH client: IP = 'f1s608wws' interface # = 47 SSH: host key initialised SSH2: starting SSH control process SSH2: Exchanging versions - SSH-1.99-Cisco-1.25 SSH2: send SSH message: outdata is NULL server version string:SSH-1.99-Cisco-1.25SSH2: receive SSH message: 83 (83) SSH2: client version is - SSH-1.5-1.34 client version string:SSH-1.5-1.34SSH2: begin server key generation SSH2: complete server key generation, elapsed time = 870 ms SSH2: declare what cipher(s) we support: 00 0x00 0x00 0x0c 0xSSH2: send SSH message: SSH_SMSG_PUBLIC_KEY (2) SSH2: SSH_SMSG_PUBLIC_KEY message sent SSH2: receive SSH message: SSH_CMSG_SESSION_KEY (3) SSH2: SSH_CMSG_SESSION_KEY message received - msg type 0x03, length 144 SSH2: client requests 3DES cipher: 3 SSH: scb created 0x6a25288, size 104 SSH2: send SSH message: SSH_SMSG_SUCCESS (14) SSH2: keys exchanged and encryption on SSH2: receive SSH message: SSH_CMSG_USER (4) SSH2: authentication request for userid admin SSH(admin): user authen method is 'use AAA', aaa server group ID = 1 SSH2: send SSH message: SSH_SMSG_FAILURE (15) SSH2: receive SSH message: SSH_CMSG_AUTH_PASSWORD (9) SSH2: send SSH message: SSH_SMSG_SUCCESS (14) SSH2: authentication successful for admin SSH2: receive SSH message: SSH_CMSG_EXEC_CMD (13) SSH2: starting exec shell And here is the debugging output of my script: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ aschwab@f1s608wws$ ./sshfw.pl Name "main::params" used only once: possible typo at ./sshfw.pl line 10. f1s608wws: Reading configuration data /home/aschwab/.ssh/config f1s608wws: Reading configuration data /etc/ssh_config f1s608wws: Connecting to f1p100fws.seydler.local, port 22. f1s608wws: Remote protocol version 1.99, remote software version Cisco-1.25 f1s608wws: Net::SSH::Perl Version 1.34, protocol version 1.5. f1s608wws: No compat match: Cisco-1.25. f1s608wws: Connection established. f1s608wws: Waiting for server public key. f1s608wws: Received server public key (768 bits) and host key (1024 bits). f1s608wws: Host 'f1p100fws.seydler.local' is known and matches the host key. f1s608wws: Encryption type: DES3 f1s608wws: Sent encrypted session key. f1s608wws: Received encryption confirmation. f1s608wws: Trying password authentication. f1s608wws: Sending command: show version f1s608wws: Entering interactive session. The script hangs afterwards and must be terminated with CTRL-C. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ Here is the debugging output when using SSH protocol version 2: aschwab@f1s608wws$ ./sshfw.pl Name "main::params" used only once: possible typo at ./sshfw.pl line 10. f1s608wws: Reading configuration data /home/aschwab/.ssh/config f1s608wws: Reading configuration data /etc/ssh_config f1s608wws: Connecting to f1p100fws.seydler.local, port 22. f1s608wws: Remote protocol version 1.99, remote software version Cisco-1.25 f1s608wws: Net::SSH::Perl Version 1.34, protocol version 2.0. f1s608wws: No compat match: Cisco-1.25. f1s608wws: Connection established. f1s608wws: Sent key-exchange init (KEXINIT), wait response. f1s608wws: Algorithms, c->s: 3des-cbc hmac-sha1 none f1s608wws: Algorithms, s->c: 3des-cbc hmac-sha1 none f1s608wws: Entering Diffie-Hellman Group 1 key exchange. f1s608wws: Sent DH public key, waiting for reply. f1s608wws: Received host key, type 'ssh-rsa'. f1s608wws: Host 'f1p100fws.seydler.local' is known and matches the host key. f1s608wws: Computing shared secret key. f1s608wws: Verifying server signature. f1s608wws: Waiting for NEWKEYS message. f1s608wws: Send NEWKEYS. f1s608wws: Enabling encryption/MAC/compression. f1s608wws: Sending request for user-authentication service. f1s608wws: Service accepted: ssh-userauth. f1s608wws: Trying empty user-authentication request. f1s608wws: Authentication methods that can continue: password. f1s608wws: Next method to try is password. f1s608wws: Trying password authentication. f1s608wws: Login completed, opening dummy shell channel. f1s608wws: channel 0: new [client-session] f1s608wws: Requesting channel_open for channel 0. f1s608wws: channel 0: open confirm rwindow 1024 rmax 4096 f1s608wws: Got channel open confirmation, requesting shell. f1s608wws: Requesting service shell on channel 0. f1s608wws: channel 1: new [client-session] f1s608wws: Requesting channel_open for channel 1. f1s608wws: Entering interactive session. f1s608wws: Channel open failure: 1: reason 4: Use of uninitialized value $stdout in print at ./sshfw.pl line 15. Use of uninitialized value $stderr in print at ./sshfw.pl line 16. Use of uninitialized value $exit in print at ./sshfw.pl line 17. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ SSH2: SSH client: IP = 'f1s608wws' interface # = 47 SSH: host key initialised SSH2: starting SSH control process SSH2: Exchanging versions - SSH-1.99-Cisco-1.25 SSH2: send SSH message: outdata is NULL server version string:SSH-1.99-Cisco-1.25SSH2: receive SSH message: 83 (83) SSH2: client version is - SSH-2.0-1.34 client version string:SSH-2.0-1.34SSH2: begin server key generation SSH2: complete server key generation, elapsed time = 590 ms SSH2 2: SSH2_MSG_KEXINIT sent SSH2 2: SSH2_MSG_KEXINIT received SSH2 0: kex_parse_kexinit: diffie-hellman-group1-sha1 SSH2 0: kex_parse_kexinit: ssh-rsa SSH2 0: kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc SSH2 0: kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc SSH2 0: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 SSH2 0: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 SSH2 0: kex_parse_kexinit: none SSH2 0: kex_parse_kexinit: none SSH2 0: kex_parse_kexinit: SSH2 0: kex_parse_kexinit: SSH2 0: kex_parse_kexinit: diffie-hellman-group1-sha1 SSH2 0: kex_parse_kexinit: ssh-dss,ssh-rsa SSH2 0: kex_parse_kexinit: 3des-cbc,blowfish-cbc,arcfour SSH2 0: kex_parse_kexinit: 3des-cbc,blowfish-cbc,arcfour SSH2 0: kex_parse_kexinit: hmac-sha1,hmac-md5 SSH2 0: kex_parse_kexinit: hmac-sha1,hmac-md5 SSH2 0: kex_parse_kexinit: none SSH2 0: kex_parse_kexinit: none SSH2 0: kex_parse_kexinit: SSH2 0: kex_parse_kexinit: SSH2: kex: client->server 3des-cbc hmac-sha1 none SSH2: kex: server->client 3des-cbc hmac-sha1 none SSH2 2: expecting SSH2_MSG_KEXDH_INIT SSH2 2: SSH2_MSG_KEXDH_INIT received dh_client_pub= 5f66c97d45ab2580 412f0723c66cda07 1dabeac438b57856 8bb1a882bc8cfd18 98fd5c5adb1028f3 260af0c8f8b1d177 e4efa8854fc75b2c 1adcc1e6f9ec0988 ffe55b019da9b213 9f3ad9490321fb4a 91bd6d371d893953 ce226c96fae42d65 ea22deeb943e725f fa4179d746d12c84 8907bd37c0c10b44 715071a947e16ceb my_dh_pub= 57f24f069c303207 7f86a571d04ff508 3371b6942660117d 0b61ef155f87e47f 3360e5c10ee66cdf 5ee5ed3f36464379 51a08c796faa0ebc 9ca50b312ad54193 c613ab2484e57f36 37d1b56dab99c55b 4637457647822e6a b4733b2bf0904211 a0e5d8e2fb2f19b2 f4b766455dd4b4eb 655e750e50919ae3 bac3e59dc7dfdaed shared secret 31d99dc902d1ff2f f087ce0d4edeb480 dd9cf5ed8523448a 99f31d40d622c0de 60aea956ae2aab04 22a4950bd5c2ec5d 78f283c9e76ae978 397e476e71d6a9bb 8f515d90d0a11ef9 4240d62e22f2147a 41f98cf1d6f88157 bd61f437b727111c 80ee2f855f3a8216 febcd7ae6434b1da 400fdf264f445f26 e91e7af77657a159 hash a0b558d46a410bcd 1f7f72ca8ea43465 240632c8 SSH2 2: signature length 143 signature 000000077373682d 727361000000801e e24116b92091541c 9c7ab0cdac90f525 0e45fbaaf863b39a bc7b66679823d1e3 6af87f2075c17da8 97eb267814af5a9b 6d3bd98bc6102e36 5eea2bac94998772 7a9dd1a8e1406cad f15dae317c2284e8 5255b67bc31a4733 817ee208b7a942fe 39f418e7857468c4 fb6cdbb86f9814ce c8aab2acc297d2e1 02d8b11bb919c3 key 2b672ec8618dd4d7 45bce80e215ad230 972a957666632cf7 key = A 2b672ec8618dd4d7 45bce80e215ad230 972a957666632cf7 key 7bd9e5a4e4be24d4 407d856ff37b0d1f 4ad1d874d0d28d95 key = B 7bd9e5a4e4be24d4 407d856ff37b0d1f 4ad1d874d0d28d95 key 70301fa848d6737c 3a27327cd39620fa 1cda94fc1d33b147 key = C 70301fa848d6737c 3a27327cd39620fa 1cda94fc1d33b147 key 3c14840b8c51d063 866029aa13748e71 4a84d8baa0c2a552 key = D 3c14840b8c51d063 866029aa13748e71 4a84d8baa0c2a552 key 93a6cf893e92d6b6 83542f8646024c84 98ce8ba0ce1ae316 key = E 93a6cf893e92d6b6 83542f8646024c84 98ce8ba0ce1ae316 key 069b66f62d12bb56 dc4084722b7ef3c3 58cf5dbc0bc94d51 key = F 069b66f62d12bb56 dc4084722b7ef3c3 58cf5dbc0bc94d51 SSH2: kex_derive_keys complete SSH2 2: newkeys: mode 1 SSH2 2: SSH2_MSG_NEWKEYS sent SSH2 2: waiting for SSH2_MSG_NEWKEYS SSH2 2: newkeys: mode 0 SSH2 2: SSH2_MSG_NEWKEYS receivedSSH(admin): user authen method is 'use AAA', aaa server group ID = 1 SSH(admin): user authen method is 'use AAA', aaa server group ID = 1 SSH2 2: authentication successful for admin SSH2 2: channel open request SSH2 2: shell request SSH2 2: shell message receivedSSH2: TCP read failed, error code = 0x86300003 "TCP connection closed" SSH2: receive SSH message: [no message ID: variable *data is NULL] SSH2: Session disconnected by SSH server - error 0x00 "Internal error" |
From: Michael S. <mic...@di...> - 2010-04-09 14:34:30
|
Hi. I'm having trouble with Net::SFTP hanging on a simple file upload. Some of the processes have stayed around for weeks. Is there any way to make it timeout and give up rather than waiting forever? -- Michael Stevens Dianomi Ltd 18 Buckingham Gate London SW1E 6LB Tel: 020 7802 5530 Fax: 020 7630 7356 www.dianomi.com The information in this message and any attachment is intended for the addressee and is confidential and may be subject to legal privilege. Dianomi Ltd, Registered Office: One America Square, Crosswall, London. EC3N 2SG. Registered in England and Wales with Company Registration Number 4513809. VAT registration number: 809754988 |
From: Mark K. <ma...@ra...> - 2010-02-25 15:18:22
|
Hi I am using sftp from Net::SSH2 on windows to upload to linux. With debug on I get these kind of messages Net::SSH2::DESTROY object 0x4726224 Net::SSH2::DESTROY object 0x4586f5c but only when I terminate my daemon, even though I am trying to disconnect/kill the instance of the SSH2 object each time I have finished with it ( at which point I get Net::SSH2::SFTP::DESTROY Net::SSH2::SFTP::DESTROY freeing session only). The next stage will be to create a mockup so I can post the actual code but this will take some time... I just thought I would mention this first in case there is a known gotcha for cleaning up Net::SSH2 objects either on win32 or generally? (Note I am fairly clueless on networky stuff in general - pls be patient :/). Thanks Mark |
From: Salvador F. <sfa...@ya...> - 2010-02-03 21:17:12
|
> >From: Ivaylo Terziyski <iva...@gm...> >To: ssh...@li... >Sent: Wed, February 3, 2010 7:26:56 PM >Subject: [Ssh-sftp-perl-users] Net::SSH::Perl issue > > >Hi, > >I am using following code to configure Juniper router: > >Frequently, this kind of devices does not support sending commands via SSH but just running an interactive shell so they are better managed using Expect or Net::SSH::Expect. Besides that, CPAN contains several packages specific to Juniper devices, maybe one of them can suit your needs. Cheers, - Salva > my $ssh = Net::SSH::Perl->new($ip, protocol => 2); >> $ssh->login($user, $pass); > foreach (@commands) > { > my($out, $err, $exit) = $ssh->cmd($_); > } > >but seems that every command in @commands is transmitted in a separate channel than the previous despite that the protocol is SSH2. >With first command I am in configuration mode (look at Log file bellow)), but the next command is executed in non-configuration mode on next channel. >What can I do to send all commands in one single channel ? >___________________________________________ >Debug output: >Reading configuration data /root/.ssh/config >Reading configuration data /etc/ssh_config >Allocated local port 1023. >Connecting to X.Y.Z.W, port 22. >Remote version string: SSH-2.0-OpenSSH_4.4 > > >Remote protocol version 2.0, remote software version OpenSSH_4.4 >Net::SSH::Perl Version 1.30, protocol version 2.0. >No compat match: OpenSSH_4.4. >Connection established. >Sent key-exchange init (KEXINIT), wait response. >Algorithms, c->s: 3des-cbc hmac-sha1 none >Algorithms, s->c: 3des-cbc hmac-sha1 none >Entering Diffie-Hellman Group 1 key exchange. >Sent DH public key, waiting for reply. >Received host key, type 'ssh-dss'. >Host 'X.Y.Z.W' is known and matches the host key. >Computing shared secret key. >Verifying server signature. >Waiting for NEWKEYS message. >Enabling incoming encryption/MAC/compression. >Send NEWKEYS, enable outgoing encryption/MAC/compression. >Sending request for user-authentication service. >Service accepted: ssh-userauth. >Trying empty user-authentication request. >Authentication methods that can continue: publickey,password,keyboard-interactive. >Next method to try is publickey. >Next method to try is password. >Trying password authentication. >Login completed, opening dummy shell channel. >channel 0: new [client-session] >Requesting channel_open for channel 0. >channel 0: open confirm rwindow 0 rmax 32768 >Got channel open confirmation, requesting shell. >Requesting service shell on channel 0. >channel 1: new [client-session] >Requesting channel_open for channel 1. >Entering interactive session. >Sending command: edit >Requesting service exec on channel 1. >channel 1: open confirm rwindow 0 rmax 32768 >input_channel_request: rtype exit-status reply 0 >channel 1: rcvd eof >channel 1: output open -> drain >channel 1: rcvd close >channel 1: input open -> closed >channel 1: close_read >channel 1: obuf empty >>channel 1: output drain -> closed >channel 1: close_write >channel 1: send close >channel 1: full closed >channel 2: new [client-session] >Requesting channel_open for channel 2. >Entering interactive session. >Sending command: set interfaces ge-1/1/0 unit 71 description VRF-XYZ >Requesting service exec on channel 2. >channel 2: open confirm rwindow 0 rmax 32768 >input_channel_request: rtype exit-status reply 0 >channel 2: rcvd eof >channel 2: output open -> drain >channel 2: rcvd close >channel 2: input open -> closed >channel 2: close_read >channel 2: obuf empty >channel 2: output drain -> closed >channel 2: close_write >channel 2: send close >channel 2: full closed >channel 3: new [client-session] >>Requesting channel_open for channel 3. >Entering interactive session. >Sending command: set interfaces ge-1/1/0 unit 71 vlan-id 71 >Requesting service exec on channel 3. >channel 3: open confirm rwindow 0 rmax 32768 >input_channel_request: rtype exit-status reply 0 >channel 3: rcvd eof >channel 3: output open -> drain >channel 3: rcvd close >channel 3: input open -> closed >channel 3: close_read >channel 3: obuf empty >channel 3: output drain -> closed >channel 3: close_write >channel 3: send close >channel 3: full closed >channel 4: new [client-session] >>Requesting channel_open for channel 4. >.... >_____________________________________________ >Log file: > > >edit >Entering configuration mode > > >set interfaces ge-1/1/0 unit 71 description VRF-XYZ > > >error: syntax error, expecting <command>: interfaces > > >set interfaces ge-1/1/0 unit 71 vlan-id 71 > > >error: syntax error, expecting <command>: interfaces > > >commit and-quit > > >error: unknown command: commit >_____________________________________________ >Thank you in advance. |
From: Ivaylo T. <iva...@gm...> - 2010-02-03 18:27:06
|
Hi, I am using following code to configure Juniper router: my $ssh = Net::SSH::Perl->new($ip, protocol => 2); $ssh->login($user, $pass); foreach (@commands) { my($out, $err, $exit) = $ssh->cmd($_); } but seems that every command in @commands is transmitted in a separate channel than the previous despite that the protocol is SSH2. With first command I am in configuration mode (look at Log file bellow)), but the next command is executed in non-configuration mode on next channel. What can I do to send all commands in one single channel ? *___________________________________________* *Debug output:* Reading configuration data /root/.ssh/config Reading configuration data /etc/ssh_config Allocated local port 1023. Connecting to X.Y.Z.W, port 22. Remote version string: SSH-2.0-OpenSSH_4.4 Remote protocol version 2.0, remote software version OpenSSH_4.4 Net::SSH::Perl Version 1.30, protocol version 2.0. No compat match: OpenSSH_4.4. Connection established. Sent key-exchange init (KEXINIT), wait response. Algorithms, c->s: 3des-cbc hmac-sha1 none Algorithms, s->c: 3des-cbc hmac-sha1 none Entering Diffie-Hellman Group 1 key exchange. Sent DH public key, waiting for reply. Received host key, type 'ssh-dss'. Host 'X.Y.Z.W' is known and matches the host key. Computing shared secret key. Verifying server signature. Waiting for NEWKEYS message. Enabling incoming encryption/MAC/compression. Send NEWKEYS, enable outgoing encryption/MAC/compression. Sending request for user-authentication service. Service accepted: ssh-userauth. Trying empty user-authentication request. Authentication methods that can continue: publickey,password,keyboard-interactive. Next method to try is publickey. Next method to try is password. Trying password authentication. Login completed, opening dummy shell channel. channel 0: new [client-session] Requesting channel_open for channel 0. channel 0: open confirm rwindow 0 rmax 32768 Got channel open confirmation, requesting shell. Requesting service shell on channel 0. channel 1: new [client-session] Requesting channel_open for channel 1. Entering interactive session. Sending command: edit Requesting service exec on channel 1. channel 1: open confirm rwindow 0 rmax 32768 input_channel_request: rtype exit-status reply 0 channel 1: rcvd eof channel 1: output open -> drain channel 1: rcvd close channel 1: input open -> closed channel 1: close_read channel 1: obuf empty channel 1: output drain -> closed channel 1: close_write channel 1: send close channel 1: full closed channel 2: new [client-session] Requesting channel_open for channel 2. Entering interactive session. Sending command: set interfaces ge-1/1/0 unit 71 description VRF-XYZ Requesting service exec on channel 2. channel 2: open confirm rwindow 0 rmax 32768 input_channel_request: rtype exit-status reply 0 channel 2: rcvd eof channel 2: output open -> drain channel 2: rcvd close channel 2: input open -> closed channel 2: close_read channel 2: obuf empty channel 2: output drain -> closed channel 2: close_write channel 2: send close channel 2: full closed channel 3: new [client-session] Requesting channel_open for channel 3. Entering interactive session. Sending command: set interfaces ge-1/1/0 unit 71 vlan-id 71 Requesting service exec on channel 3. channel 3: open confirm rwindow 0 rmax 32768 input_channel_request: rtype exit-status reply 0 channel 3: rcvd eof channel 3: output open -> drain channel 3: rcvd close channel 3: input open -> closed channel 3: close_read channel 3: obuf empty channel 3: output drain -> closed channel 3: close_write channel 3: send close channel 3: full closed channel 4: new [client-session] Requesting channel_open for channel 4. .... _____________________________________________ *Log file:* edit Entering configuration mode set interfaces ge-1/1/0 unit 71 description VRF-XYZ error: syntax error, expecting <command>: interfaces set interfaces ge-1/1/0 unit 71 vlan-id 71 error: syntax error, expecting <command>: interfaces commit and-quit error: unknown command: commit _____________________________________________ Thank you in advance. |
From: Daniel R. <da...@ph...> - 2009-11-25 23:49:22
|
I have encountered a problem with Net::SSH::Perl I'm using perl 5.8.5 When we try to issue a command with "cmd" it's never returning. The process on the other side exits, leaves behind a zombie bash process, but sshd does not, thus "cmd" never returns. -- Daniel |
From: Len, C. <CL...@sj...> - 2009-11-09 18:39:35
|
Hello, I installed Net::SSH2 v0.28 on top of a i386-Linux perl v5.6.1 distribution, with supporting libgcrypt-1.1.12 and libssh2-1.2.1 C libraries. "make test" passed (albeit 65/75 skipped for "various reasons") at install time. (Test-Simple-0.94, Test-Harness-2.64, and ExtUtils-MakeMaker-6.4.2 were also installed for purposes of ensuring successful "make test" run) During use, login attempts via SSH2 into my remote server are successful, as are directory listings. But I get this error when attempting to create the IO object, for a SCP get file transfer: "stat is not of type HVPtr at /usr/local/lib/perl/5.6.1/Net/SSH2.pm line 317". I have tried updating IO (containing ::File) to latest v1.2.5 (suspecting old version incompatibility), it did not help. My test code is below my signature, based on an excerpt taken from http://www.perlmonks.org/?node_id=569657 Any help would be appreciated! Thank you, Chris Len St. Jude Medical <http://www.sjm.com/> cl...@sj... <mailto:cl...@sj...> #!/usr/bin/perl use warnings; use strict; use Net::SSH2; use IO::File; my $ssh2 = Net::SSH2->new(); $ssh2->connect('myhost.mydomain') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('myuser','mypass') or die "Unable to login $@ \n"; print("Logged in successfully, attempting file listing\n"); my $sftp = $ssh2->sftp(); my $dir1 = '/tmp/'; my $dh = $sftp->opendir($dir1); while(my $item = $dh->read) { print $item->{'name'},"\n"; } print("List successful, attempting file download \n"); my $remote1 = '/tmp/big100mb.file'; #FAILURE AT BELOW LINE my $local1 = IO::File->new("> /tmp/download.file"); $ssh2->scp_get($remote1, $local1); This communication, including any attachments, may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are hereby notified that you are not authorized to read, print, retain a copy of or disseminate any portion of this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please immediately notify the sender via return e-mail and delete it from your system. |
From: Arifuddin, A. <Ari...@xe...> - 2009-11-03 18:27:51
|
Thanks, What works in this case i just put the directory name for both from and to without wild-carding... regards, Ari...@Xe... -----Original Message----- From: Vikas Poonia [mailto:vik...@ya...] Sent: Tue 11/3/2009 1:25 AM To: Arifuddin, Arif Subject: Re: [Ssh-sftp-perl-users] Net::SFTP::Foreign; results I think in place of from and to in below statement if (!$sftp->rget("/from*", "/to")) { print "Failed to Transfer: ".$sftp->error; } try to pass exact name of directory. For testing purpose if that is working then you need to store this from and to in some variable and then use those variable in this function. I am not expert but may be this can help you bit. --- On Fri, 10/30/09, Arifuddin, Arif <Ari...@xe...> wrote: From: Arifuddin, Arif <Ari...@xe...> Subject: [Ssh-sftp-perl-users] Net::SFTP::Foreign; results To: ssh...@li... Date: Friday, October 30, 2009, 6:01 AM Help: i have the following script running but i get the results as such? #!/usr/bin/perl use lib '../modules'; use strict; use Net::SFTP::Foreign; $|=1; print "Connecting..."; my $sftp = Net::SFTP::Foreign->new('ipaddress', user=>'xyz', password=>'123'); if (not $sftp) { die("Error: No Connection:$@"); } elsif ($sftp->error) { die("Connect Failed : ".$sftp->status); } else { print "Connected!\n"; if (!$sftp->rget("/from*", "/to")) { print "Failed to Transfer: ".$sftp->error; } else { print "Transfer Done!!"; } print "\nFinished\n"; end of script: Why am i getting the following result....if someone can help? Connecting...Connected! Failed to Transfer: Couldn't stat remote file (lstat): No such file regards, Ari...@Xe... ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Salvador F. <sfa...@ya...> - 2009-10-30 01:00:02
|
----- Original Message ---- > From: "Arifuddin, Arif" <Ari...@xe...> > To: ssh...@li... > Sent: Fri, October 30, 2009 1:31:28 AM > Subject: [Ssh-sftp-perl-users] Net::SFTP::Foreign; results > > > Help: i have the following script running but i get the results as such? > > #!/usr/bin/perl > use lib '../modules'; > use strict; > use Net::SFTP::Foreign; > $|=1; > print "Connecting..."; > my $sftp = Net::SFTP::Foreign->new('ipaddress', > user=>'xyz', > password=>'123'); > if (not $sftp) { > die("Error: No Connection:$@"); > } > elsif ($sftp->error) { > die("Connect Failed : ".$sftp->status); > } > else { > print "Connected!\n"; > if (!$sftp->rget("/from*", "/to")) { > print "Failed to Transfer: ".$sftp->error; > } > else { > print "Transfer Done!!"; > } > print "\nFinished\n"; > > end of script: > > Why am i getting the following result....if someone can help? > > > Connecting...Connected! > Failed to Transfer: Couldn't stat remote file (lstat): No such file "rget" does not understand willcards. You can do it as follows: my @from = $sftp->glob("/from*"); for my $from (@from) { $sftp->rget($from, "/to") or print "unable to retrieve $from: ". $sftp->error; } - Salva |
From: Arifuddin, A. <Ari...@xe...> - 2009-10-30 00:44:16
|
Help: i have the following script running but i get the results as such? #!/usr/bin/perl use lib '../modules'; use strict; use Net::SFTP::Foreign; $|=1; print "Connecting..."; my $sftp = Net::SFTP::Foreign->new('ipaddress', user=>'xyz', password=>'123'); if (not $sftp) { die("Error: No Connection:$@"); } elsif ($sftp->error) { die("Connect Failed : ".$sftp->status); } else { print "Connected!\n"; if (!$sftp->rget("/from*", "/to")) { print "Failed to Transfer: ".$sftp->error; } else { print "Transfer Done!!"; } print "\nFinished\n"; end of script: Why am i getting the following result....if someone can help? Connecting...Connected! Failed to Transfer: Couldn't stat remote file (lstat): No such file regards, Ari...@Xe... |