ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 33)
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: Vladimir P. <vla...@ar...> - 2005-01-05 02:53:59
|
Find 'services' file (c:\windows\system32\drivers\etc ?) and add a line: ssh 22/tcp Quoting Roderick A. Anderson (raa...@ts...): > A search in the list archives turns up nothing for > > Can't map service name 'ssh' to port number at > D:/Perl/site/lib/Net/SFTP.pm line 36 > > when I run a simple test script. Looking at the code it seems $ssh is > used before it is assigned a value by the _open_channel subroutine. > > Before I go and fiddle with the code myself has anyone experienced this > before? Is there something else I'm missing or forgetting to do? > > > ActivePerl Build 804 > All the SSH, and SFTP goodies installed. > > > TIA, > Rod > -- > --- > [This E-mail scanned for viruses by Declude Virus] > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > -- .signature: No such file or directory |
From: Roderick A. A. <raa...@ts...> - 2005-01-05 02:10:33
|
A search in the list archives turns up nothing for Can't map service name 'ssh' to port number at D:/Perl/site/lib/Net/SFTP.pm line 36 when I run a simple test script. Looking at the code it seems $ssh is used before it is assigned a value by the _open_channel subroutine. Before I go and fiddle with the code myself has anyone experienced this before? Is there something else I'm missing or forgetting to do? ActivePerl Build 804 All the SSH, and SFTP goodies installed. TIA, Rod -- --- [This E-mail scanned for viruses by Declude Virus] |
From: David R. <dr...@at...> - 2004-12-22 20:39:59
|
> From: ssh...@li... > [mailto:ssh...@li...]On Behalf Of > Robert Landrum > Sent: Wednesday, December 22, 2004 2:49 PM > Subject: Re: [Ssh-sftp-perl-users] Net::SFTP Patch >=20 > > Ideally undef'ing drops the refcount to zero, which=20 > destroys the Net::SFTP object, which cascades to the=20 > Net::SSH::Perl and its sub-objects and eventually the socket=20 > is closed. >=20 > The refcount doesn't reach zero. Because Socket is used, and because > Socket does the gensym call, the reference created from the resulting = file > handle, when collected, doesn't release the symbol. As I recall, it = has=20 > something to due with scope, but my memory is hazy. All this=20 > is done within Net::SSH::Perl. An explicit close needs to be called = on the=20 > filehandle (which I don't think is happening) in order for it to=20 > correctly close the socket because apache/mod_perl process will never = (or rarely)=20 > garbage collect it. Are you using the latest Net::SSH::Perl (or at least a version >=3D = 1.24)? In the version I have (1.25) there's a _create_socket that calls gensym = directly. This quick test shows there's nothing innate about gensyms that stops = them from being destroyed when they go out of scope: perl -MSymbol -wle '{sub Foo::DESTROY { print "DESTROY" } my = $a=3Dgensym; bless $a, "Foo";} print "OUTER"' prints "DESTROY" and then "OUTER" as expected. Since perl does refcounted g/c, it's either yes or no; I don't think = "rarely" is an option, as it might be for Java, which uses its own = heuristics to decide when to g/c and isn't refcount based. > Robert Landrum > Systems Programmer --=20 Dave Isa. 40:31 |
From: Robert L. <rla...@ao...> - 2004-12-22 19:54:37
|
On Wed, Dec 22, 2004 at 12:57:29PM -0500, David Robins wrote: > undef'ing the object works fine for me - would you happen to be using a version of perl earlier than 5.6? I know with 5.005003 it's easy to leak handles. > From a perl script it should work fine. From mod_perl, it doesn't. We're using 5.6.1. > I'm not the maintainer, but it might be preferable to find out why undef'ing fails before adding code. > > Ideally undef'ing drops the refcount to zero, which destroys the Net::SFTP object, which cascades to the Net::SSH::Perl and its sub-objects and eventually the socket is closed. > The refcount doesn't reach zero. Because Socket is used, and because Socket does the gensym call, the reference created from the resulting file handle, when collected, doesn't release the symbol. As I recall, it has something to due with scope, but my memory is hazy. All this is done within Net::SSH::Perl. An explicit close needs to be called on the filehandle (which I don't think is happening) in order for it to correctly close the socket because apache/mod_perl process will never (or rarely) garbage collect it. At least that's my theory. Rob -- Robert Landrum Systems Programmer |
From: evegdahl v. <eve...@ve...> - 2004-12-22 18:52:27
|
Glad to see I am not alone... I first decribed the exact same problem back in august.... but no one respo= nded. Connection/channel it does not seem to make any difference, they ar= e running in a different shell. This is not desirable. I was looking for= the same functionality of the Net::tlenet module. But this does not seem = to be it. Here is a sample program I have tried to run: #!/usr/perl5/5.8.5/bin/perl use Net::SSH::Perl; use Net::SSH::Perl::Cipher; # $t =3D Net::SSH::Perl->new("c_9509_b",port =3D> 22, protocal =3D> 2, cip= her =3D> blowfish-cbc, debug =3D> 1); $t =3D Net::SSH::Perl->new("c_9509_b",port =3D> 22, options =3D> ["protocal= 2"], debug =3D> 1); $t->login("user","password"); # ($out,$err,$exit) =3D $t->cmd("config t"); printf(STDOUT "Exit code =3D \"$exit\"\n"); printf(STDOUT "STDOUT =3D \"$out\"\n"); printf(STDOUT "STDERR =3D \"$err\"\n"); ($out,$err,$exit) =3D $t->cmd("fcalias name D280_23_a1 vsan 1"); printf(STDOUT "Exit code =3D \"$exit\"\n"); printf(STDOUT "STDOUT =3D \"$out\"\n"); printf(STDOUT "STDERR =3D \"$err\"\n"); ($out,$err,$exit) =3D $t->cmd("member pwwn 200200a0b80f6bf5"); printf(STDOUT "Exit code =3D \"$exit\"\n"); printf(STDOUT "STDOUT =3D \"$out\"\n"); printf(STDOUT "STDERR =3D \"$err\"\n"); ($out,$err,$exit) =3D $t->cmd("exit"); printf(STDOUT "Exit code =3D \"$exit\"\n"); printf(STDOUT "STDOUT =3D \"$out\"\n"); printf(STDOUT "STDERR =3D \"$err\"\n"); This program produces the output: ~/cur> ed1 sb8: Reading configuration data /home/evegdahl/.ssh/config sb8: Reading configuration data /etc/ssh_config sb8: Connecting to c_9509_b, port 22. sb8: Remote protocol version 2.0, remote software version OpenSSH_3.5p1 sb8: Net::SSH::Perl Version 1.25, protocol version 2.0. sb8: No compat match: OpenSSH_3.5p1. sb8: Connection established. sb8: Sent key-exchange init (KEXINIT), wait response. sb8: Algorithms, c->s: 3des-cbc hmac-sha1 none sb8: Algorithms, s->c: 3des-cbc hmac-sha1 none sb8: Entering Diffie-Hellman Group 1 key exchange. sb8: Sent DH public key, waiting for reply. sb8: Received host key, type 'ssh-dss'. sb8: Host 'c_9509_b' is known and matches the host key. sb8: Computing shared secret key. sb8: Verifying server signature. sb8: Waiting for NEWKEYS message. sb8: Enabling incoming encryption/MAC/compression. sb8: Send NEWKEYS, enable outgoing encryption/MAC/compression. sb8: Sending request for user-authentication service. sb8: Service accepted: ssh-userauth. sb8: Trying empty user-authentication request. sb8: Authentication methods that can continue: publickey,password,keyboard-= interactive. sb8: Next method to try is publickey. sb8: Next method to try is password. sb8: Trying password authentication. sb8: Login completed, opening dummy shell channel. sb8: channel 0: new [client-session] sb8: Requesting channel_open for channel 0. sb8: channel 0: open confirm rwindow 0 rmax 32768 sb8: Got channel open confirmation, requesting shell. sb8: Requesting service shell on channel 0. sb8: channel 1: new [client-session] sb8: Requesting channel_open for channel 1. sb8: Entering interactive session. sb8: Sending command: config t sb8: Requesting service exec on channel 1. sb8: channel 1: open confirm rwindow 0 rmax 32768 sb8: channel 0: rcvd eof sb8: channel 0: output open -> drain sb8: channel 0: rcvd close sb8: channel 0: input open -> closed sb8: channel 0: close_read sb8: input_channel_request: rtype exit-status reply 0 sb8: channel 1: rcvd eof sb8: channel 1: output open -> drain sb8: channel 1: rcvd close sb8: channel 1: input open -> closed sb8: channel 1: close_read sb8: channel 1: obuf empty sb8: channel 1: output drain -> closed sb8: channel 1: close_write sb8: channel 1: send close sb8: channel 1: full closed Exit code =3D "0" STDOUT =3D "" STDERR =3D "" sb8: channel 2: new [client-session] sb8: Requesting channel_open for channel 2. sb8: Entering interactive session. sb8: Sending command: fcalias name D280_23_a1 vsan 1 sb8: Requesting service exec on channel 2. sb8: channel 2: open confirm rwindow 0 rmax 32768 sb8: input_channel_request: rtype exit-status reply 0 sb8: channel 2: rcvd eof sb8: channel 2: output open -> drain sb8: channel 2: rcvd close sb8: channel 2: input open -> closed sb8: channel 2: close_read sb8: channel 2: obuf empty sb8: channel 2: output drain -> closed sb8: channel 2: close_write sb8: channel 2: send close sb8: channel 2: full closed Exit code =3D "11" STDOUT =3D " Cmd parse error. " STDERR =3D "" sb8: channel 3: new [client-session] sb8: Requesting channel_open for channel 3. sb8: Entering interactive session. sb8: Sending command: member pwwn 200200a0b80f6bf5 sb8: Requesting service exec on channel 3. sb8: channel 3: open confirm rwindow 0 rmax 32768 sb8: input_channel_request: rtype exit-status reply 0 sb8: channel 3: rcvd eof sb8: channel 3: output open -> drain sb8: channel 3: rcvd close sb8: channel 3: input open -> closed sb8: channel 3: close_read sb8: channel 3: obuf empty sb8: channel 3: output drain -> closed sb8: channel 3: close_write sb8: channel 3: send close sb8: channel 3: full closed Exit code =3D "11" STDOUT =3D " Cmd parse error. " STDERR =3D "" sb8: channel 4: new [client-session] sb8: Requesting channel_open for channel 4. sb8: Entering interactive session. sb8: Sending command: exit sb8: Requesting service exec on channel 4. sb8: channel 4: open confirm rwindow 0 rmax 32768 sb8: input_channel_request: rtype exit-status reply 0 sb8: channel 4: rcvd eof sb8: channel 4: output open -> drain sb8: channel 4: rcvd close sb8: channel 4: input open -> closed sb8: channel 4: close_read sb8: channel 4: obuf empty sb8: channel 4: output drain -> closed sb8: channel 4: close_write sb8: channel 4: send close sb8: channel 4: full closed Exit code =3D "0" STDOUT =3D "" STDERR =3D "" ~/cur> ---------- Original Message ---------------------------------- From: Mihai Secasiu <mih...@de...> Date: Mon, 13 Dec 2004 12:33:34 +0200 Did you try creating the ssh object like this: Net::SSH::Perl->new($domain,port =3D> $port,options =3D> ["Protocol 2"])) On Monday 13 December 2004 08:00, Andersson, Kimmo wrote: > Hi ! > > The documentation says so and You say so but that does not work. At least= > the results are not what You want. > > I had a similar case. On a HP-UX machine I wanted to import an Oracle > export file which my Perl script had transferred using FTP. To use Import= I > have to setup the environment first (first command) using a shell script.= > However I'm certain that SSH 2 was used but the environment settings were= > lost while issuing the second command (import). > > To maintain the environment setting I had to chain the two commands into > one command. > Using Your example something like this: > ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE";"print $FOO";); > > That should work irrespective of the SSH version. > > BR Kimmo Andersson > Jyv=E4skyl=E4, Finland > > >you can execute multiple commands on the same channel if you use SSH 2 > > > >On Friday 10 December 2004 13:03, Wildish, Joe wrote: > >> I originally thought that I could use Net::SSH::Perl to issue multiple= > >> commands in the same shell. However, having looked into it a little > >> more, it seems that this is not the default behaviour. I have done a > >> little research, and it appears that a seperate channel is created eac= h > >> time the cmd method is called - which effectively creates a new shell.= > >> > >> I am wanting to execute the commands in the same shell. For example: > >> > >> ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE"); > >> ($out2,$err2,$rc2) =3D $ssh->cmd("print $FOO"); > >> > >> $out2 would equal "WIBBLE".... > >> > >> I think I can probably achieve this behaviour by registering a handler= > >> and iterating through each of the commands I want to issue within the > >> subroutine, but this doesn't seem the nicest way. Ideally, if I could > >> pass in the channel number to the cmd method, that would be cool... I = am > >> assuming of course that there are no problems with this approach? > >> > >> I was hoping people on this list may have come across this requirement= > >> before, and could perhaps point me in the right direction .... (?) > >> > >> Regards, > >> Joe > > > >-- > >+-----------------------------------------------------------------------= > > > >| Mihai Secasiu > >| http://denixsolutions.com/ > >| Complete Unix/Linux Solutions for your Business > > > >+-----------------------------------------------------------------------= > > > > > >--__--__-- > > > >Message: 2 > >From: Mihai Secasiu <mih...@de...> > >Organization: Denix Solutions > >To: ssh...@li... > >Subject: Re: [Ssh-sftp-perl-users] Net::SFTP error handling - patch? > >Date: Sun, 12 Dec 2004 20:20:42 +0200 > > > >You can send the patch here, I will review it and merge it into the code= . > > > >On Friday 10 December 2004 23:48, David Robins wrote: > >> I'd like to add some error handling with the result of having > >> Net::SFTP's put method return success (true)/failure (false), and > >> perhaps some other patches too: > >> > >> - similar return for 'get' (unless there's no local file specified, in= > >> which case the file contents are returned) (as reported [not by me] > >> about > > > >a > > > >> year ago at http://rt.cpan.org/NoAuth/Bug.html?id=3D4610) - allow warn= ings > > > >to > > > >> be redirected to a callback (or turned off), defaulting to warn for > >> backwards compatibility > >> > >> If these seem like a good idea I'll write up and submit a patch (if I > >> do, where should I send it to, this list?) > >> > >> Thanks, > > > >-- > >+-----------------------------------------------------------------------= > > > >| Mihai Secasiu > >| http://denixsolutions.com/ > >| Complete Unix/Linux Solutions for your Business > > > >+-----------------------------------------------------------------------= > > > > > > > >--__--__-- > > > >_______________________________________________ > >Ssh-sftp-perl-users mailing list > >Ssh...@li... > >https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > > > > >End of Ssh-sftp-perl-users Digest -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ________________________________________________________________ Sent via the WebMail system at vegdahl.com |
From: David R. <dr...@at...> - 2004-12-22 17:57:44
|
> From: ssh...@li... > [mailto:ssh...@li...]On Behalf Of > Robert Landrum > Sent: Wednesday, December 22, 2004 11:10 AM > Subject: [Ssh-sftp-perl-users] Net::SFTP Patch >=20 > It came to my attention that Bricolage which uses Net::SFTP=20 > was leaving sshd connections open. The Bric dev guys were doing a = undef=20 > $sftp; to close the connection, but that wasn't sufficient to close = the=20 > connection. And with apache not exiting at the end of the request = cycle to force the=20 > connection closed, our server quickly ran out of open file handles. undef'ing the object works fine for me - would you happen to be using a = version of perl earlier than 5.6? I know with 5.005003 it's easy to = leak handles. > I've added a close_connection method to the Net::SFTP module, and = thought > that others might have use for such a method. I also added a DESTROY > method, which I don't think necessarily belongs, but which I added = just > so I wouldn't have to muck with the Bric code too... I'm not the maintainer, but it might be preferable to find out why = undef'ing fails before adding code. Ideally undef'ing drops the refcount to zero, which destroys the = Net::SFTP object, which cascades to the Net::SSH::Perl and its = sub-objects and eventually the socket is closed. > Robert Landrum > Systems Programmer --=20 Dave Isa. 40:31 |
From: Robert L. <rla...@ao...> - 2004-12-22 16:15:52
|
It came to my attention that Bricolage which uses Net::SFTP was leaving sshd connections open. The Bric dev guys were doing a undef $sftp; to close the connection, but that wasn't sufficient to close the connection. And with apache not exiting at the end of the request cycle to force the connection closed, our server quickly ran out of open file handles. I've added a close_connection method to the Net::SFTP module, and thought that others might have use for such a method. I also added a DESTROY method, which I don't think necessarily belongs, but which I added just so I wouldn't have to muck with the Bric code too... Happy Holidays, Rob -- Robert Landrum Systems Programmer |
From: David R. <dr...@at...> - 2004-12-22 14:12:47
|
> -----Original Message----- > From: ssh...@li... > [mailto:ssh...@li...]On Behalf Of > Rishi Kaundinya M > Sent: Wednesday, December 22, 2004 6:53 AM > To: ssh...@li... > Subject: [Ssh-sftp-perl-users] Urgent, Problems with the = Net::SSH::Perl package >=20 > I am using the above package and using the perl2exe to generate the > final binary. I am getting a segmentation fault (SIGSEGV) in=20 > my program at the following method. >=20 > eval > { > $ssh->login ($config{$login}, $config{pw}); > } >=20 > Is there any known problem with the $ssh->login. Or could it be > a problem with the perl2exe. I am seeing the program terminating > consistently at the above point. Does it terminate there _without_ perl2exe? If not, then you can = probably chalk it up to a perl2exe problem. You may want to try running it under your platform's debugger (gdb, dbx, = whatever) or debugging the core file, if there is one; that will tell = you exactly where the fault occurred and may give more insight (of = course if it's in perl itself then it won't tell you what module it died = in, but odds are it's either perl2exe or an XS module). > Also, I did not see any method exported to free the $ssh=20 > object created in the following statement. >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > While(1) > { > $ssh =3D Net::SSH::Perl->new($config{$name}, protocol=3D>2, = debug=3D>0, po > rt=3D>22); > Do some thing. After the first loop, when you reassign $ssh the first object's refcount = should drop to 0 and it will be destroyed automatically, including = closing sockets etc. Note that if you are using perl version < 5.6 then you WILL have leaks = since there are circular references; the fix is in Net::SSH::Perl 1.24 I = believe, which takes advantage of 5.6's weak references. --=20 Dave Isa. 40:31 |
From: Rishi K. M <kau...@in...> - 2004-12-22 11:55:41
|
Hi experts, I am using the above package and using the perl2exe to generate the final binary. I am getting a segmentation fault (SIGSEGV) in my program at the following method. eval { $ssh->login ($config{$login}, $config{pw}); } Is there any known problem with the $ssh->login. Or could it be A problem with the perl2exe. I am seeing the program terminating consitenetly At the above point. Also, I did not see any method exported to free the $ssh object created in the Following statement. ===================================================================== While(1) { $ssh = Net::SSH::Perl->new($config{$name}, protocol=>2, debug=>0, po rt=>22); Do some thing. .......................... --------------------- --How to delete the new object????????????? } ====================================================================== I tried $ssh->_disconnect(). But it does not seem to be close the socket and Release the memory. I am connecting to the hosts in a infinite while loop. I am suspecting potential memory leak with the repeated invocation of the new methods Can you please let me know any method which free the $ssh object created in the new. Thanks & Regards, Rishi |
From: Vladimir P. <vla...@ar...> - 2004-12-21 13:55:30
|
I've been using Net::SSH::Perl for years. I wrote scripts to pull configs/transfer data/whatever from Solaris/Linux/BSD and even m$win (running Vshell) boxes using standard methods. I was able to make Net::SSH::Perl work with Cisco switches/routers/PIXes runing V1 daemons (using handlers). Now cisco (finaly) came out with SSH2 daemons (good morning, cisco) and even handlers don't work. I've collected some debug info on the cisco side and would like to work with the maintainers of this module(s) in order to move it ahead. As far as I know, Ben and Dave are no longer taking care of it... Would the new "owner" step up? Thanks. -- .signature: No such file or directory |
From: David R. <dr...@at...> - 2004-12-14 21:07:27
|
Patch is attached. It makes the following changes, all of which I = believe are backwards compatible: 1. adds a 'warn' argument to the constructor; it can be true (default - = warn as usual), false (supress the output of warnings), or a sub ref = (called with the SFTP object and the warning text) 2. adds a 'status' method which returns the last SSH2_FX_* status value, = or (status value, text) in list context (only useful after last failure) 3. allows ssh_args to be either a hash ref or an array ref 4. adds brief summary comments to some methods 5. returns failure if the remote open fails for 'get' (current code = ignored it); also moves the remote open before the local open so that we = don't create empty local files if the remote file can't be opened 6. changes ls to return an array reference in scalar context 7. documents: the fact that we die on protocol/local errors; the new = option and method; changes to get/put (formerly 'put' didn't return = anything useful, and 'get's actual return values are the same, just = better documented) 8. adds a comprehensive remote test, but to use it one has to manually = go in and configure a server a certain way, so it defaults to skipping = everything; I'm including it as a base since there are currently no = remote tests at all Naturally, modify as you see fit, or if you need me to make changes I'll = be glad to. > -----Original Message----- > From: ssh...@li... > [mailto:ssh...@li...]On Behalf Of > Mihai Secasiu > Sent: Sunday, December 12, 2004 1:21 PM > To: ssh...@li... > Subject: Re: [Ssh-sftp-perl-users] Net::SFTP error handling - patch? >=20 >=20 > You can send the patch here, I will review it and merge it=20 > into the code.=20 > On Friday 10 December 2004 23:48, David Robins wrote: > > I'd like to add some error handling with the result of=20 > having Net::SFTP's > > put method return success (true)/failure (false), and=20 > perhaps some other > > patches too: > > > > - similar return for 'get' (unless there's no local file=20 > specified, in > > which case the file contents are returned) (as reported=20 > [not by me] about a > > year ago at http://rt.cpan.org/NoAuth/Bug.html?id=3D4610) -=20 > allow warnings to > > be redirected to a callback (or turned off), defaulting to warn for > > backwards compatibility > > > > If these seem like a good idea I'll write up and submit a=20 > patch (if I do, > > where should I send it to, this list?) |
From: David R. <dr...@at...> - 2004-12-14 03:45:22
|
The patch alluded to in the message "Fix for Net::SFTP 'ls' Math::Pari = leak" that I posted on 2004-12-10 is attached to this message. = Net::SFTP fixes should follow later this week. Thanks, --=20 Dave Isa. 40:31 |
From: Mihai S. <mih...@de...> - 2004-12-13 11:33:57
|
On Monday 13 December 2004 13:00, Wildish, Joe wrote: > I understood from the documentation that SSH 1 would create a new > connection each time, rather than channel (?). However, it could well be > me mis-reading it (I'm no SSH expert). Sorry,... was my mistake I missunderstood you, I thought your problem was it creates multiple connections. > > Anyway, you got me thinking; I was not specifying the protocol version > to use in the constructor. So, I tried specifiying "2", but the debug > output still indicates there are multiple channels in use. I then > remembered I didn't even compile in SSH1 support when I made the module, > so it must have been using 2 all along. > > Incidently, I was getting this in the debug output: > > <hostname>: Remote protocol version 2.0, remote software version 3.0.1 > F-SECURE SSH > <hostname>: Net::SSH::Perl Version 1.25, protocol version 2.0. > <hostname>: No compat match: 3.0.1 F-SECURE SSH > > I had a quick look through the code and it would seem F-Secure isn't > checked for. So I put an entry in to match it, with a mask of zero, but > the results were the same. > > Any other ideas? > > Thanks, > Joe > > -----Original Message----- > From: ssh...@li... > [mailto:ssh...@li...] On Behalf Of > Mihai Secasiu > Sent: 12 December 2004 18:17 > To: ssh...@li... > Subject: Re: [Ssh-sftp-perl-users] Multiple operations in a single > channel/shell? (Net::SSH) > > > you can execute multiple commands on the same channel if you use SSH 2 > > On Friday 10 December 2004 13:03, Wildish, Joe wrote: > > I originally thought that I could use Net::SSH::Perl to issue multiple > > > > commands in the same shell. However, having looked into it a little > > more, it seems that this is not the default behaviour. I have done a > > little research, and it appears that a seperate channel is created > > each time the cmd method is called - which effectively creates a new > > shell. > > > > I am wanting to execute the commands in the same shell. For example: > > > > ($out,$err,$rc) = $ssh->cmd("export FOO=WIBBLE"); > > ($out2,$err2,$rc2) = $ssh->cmd("print $FOO"); > > > > $out2 would equal "WIBBLE".... > > > > I think I can probably achieve this behaviour by registering a handler > > > > and iterating through each of the commands I want to issue within the > > subroutine, but this doesn't seem the nicest way. Ideally, if I could > > pass in the channel number to the cmd method, that would be cool... I > > am assuming of course that there are no problems with this approach? > > > > I was hoping people on this list may have come across this requirement > > > > before, and could perhaps point me in the right direction .... (?) > > > > Regards, > > Joe -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: Wildish, J. <Joe...@ca...> - 2004-12-13 11:06:04
|
Hi there! =20 I noticed that I can chain commands together in that fashion. However, = I'm trying to write a generic handler for issuing multiple commands on a = box - I want to be able to check return codes, ouptut, etc, before = moving onto the next command; of course, I also want the commands to be = in the same shell.... :-) I have some (nasty) work arounds, but I'm = really hoping I can get this working first. =20 Regards, Joe -----Original Message----- From: ssh...@li... = [mailto:ssh...@li...] On Behalf Of = Andersson, Kimmo Sent: 13 December 2004 06:01 To: 'ssh...@li...' Subject: [Ssh-sftp-perl-users] RE: Ssh-sftp-perl-users digest, Vol 1 = #59 - 2 msgs =09 =09 Hi !=20 The documentation says so and You say so but that does not work. At = least the results are not what You want.=20 I had a similar case. On a HP-UX machine I wanted to import an Oracle = export file which my Perl script had transferred using FTP. To use = Import I have to setup the environment first (first command) using a = shell script. However I'm certain that SSH 2 was used but the = environment settings were lost while issuing the second command = (import). To maintain the environment setting I had to chain the two commands = into one command.=20 Using Your example something like this:=20 ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE";"print $FOO";);=20 That should work irrespective of the SSH version.=20 =20 BR Kimmo Andersson=20 Jyv=E4skyl=E4, Finland=20 >you can execute multiple commands on the same channel if you use SSH 2 = >On Friday 10 December 2004 13:03, Wildish, Joe wrote:=20 >> I originally thought that I could use Net::SSH::Perl to issue = multiple=20 >> commands in the same shell. However, having looked into it a little=20 >> more, it seems that this is not the default behaviour. I have done a = >> little research, and it appears that a seperate channel is created = each=20 >> time the cmd method is called - which effectively creates a new = shell.=20 >>=20 >> I am wanting to execute the commands in the same shell. For example: = >>=20 >> ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE");=20 >> ($out2,$err2,$rc2) =3D $ssh->cmd("print $FOO");=20 >>=20 >> $out2 would equal "WIBBLE"....=20 >>=20 >> I think I can probably achieve this behaviour by registering a = handler=20 >> and iterating through each of the commands I want to issue within = the=20 >> subroutine, but this doesn't seem the nicest way. Ideally, if I = could=20 >> pass in the channel number to the cmd method, that would be cool... = I am=20 >> assuming of course that there are no problems with this approach?=20 >>=20 >> I was hoping people on this list may have come across this = requirement=20 >> before, and could perhaps point me in the right direction .... (?)=20 >>=20 >> Regards,=20 >> Joe=20 >=20 >--=20 = >+-----------------------------------------------------------------------= =20 >| Mihai Secasiu=20 >| http://denixsolutions.com/=20 >| Complete Unix/Linux Solutions for your Business=20 = >+-----------------------------------------------------------------------= =20 >=20 >=20 >--__--__--=20 >=20 >Message: 2=20 >From: Mihai Secasiu <mih...@de...>=20 >Organization: Denix Solutions=20 >To: ssh...@li...=20 >Subject: Re: [Ssh-sftp-perl-users] Net::SFTP error handling - patch?=20 >Date: Sun, 12 Dec 2004 20:20:42 +0200=20 >=20 >You can send the patch here, I will review it and merge it into the = code.=20 >On Friday 10 December 2004 23:48, David Robins wrote:=20 >> I'd like to add some error handling with the result of having = Net::SFTP's=20 >> put method return success (true)/failure (false), and perhaps some = other=20 >> patches too:=20 >>=20 >> - similar return for 'get' (unless there's no local file specified, = in=20 >> which case the file contents are returned) (as reported [not by me] = about=20 >a=20 >> year ago at http://rt.cpan.org/NoAuth/Bug.html?id=3D4610) - allow = warnings=20 >to=20 >> be redirected to a callback (or turned off), defaulting to warn for=20 >> backwards compatibility=20 >>=20 >> If these seem like a good idea I'll write up and submit a patch (if = I do,=20 >> where should I send it to, this list?)=20 >>=20 >> Thanks,=20 >=20 >--=20 = >+-----------------------------------------------------------------------= =20 >| Mihai Secasiu=20 >| http://denixsolutions.com/=20 >| Complete Unix/Linux Solutions for your Business=20 = >+-----------------------------------------------------------------------= =20 >=20 >=20 >=20 >--__--__--=20 >=20 >_______________________________________________=20 >Ssh-sftp-perl-users mailing list=20 >Ssh...@li...=20 >https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users=20 >=20 >=20 >End of Ssh-sftp-perl-users Digest=20 |
From: Wildish, J. <Joe...@ca...> - 2004-12-13 11:00:25
|
I understood from the documentation that SSH 1 would create a new connection each time, rather than channel (?). However, it could well be me mis-reading it (I'm no SSH expert). Anyway, you got me thinking; I was not specifying the protocol version to use in the constructor. So, I tried specifiying "2", but the debug output still indicates there are multiple channels in use. I then remembered I didn't even compile in SSH1 support when I made the module, so it must have been using 2 all along. Incidently, I was getting this in the debug output: <hostname>: Remote protocol version 2.0, remote software version 3.0.1 F-SECURE SSH <hostname>: Net::SSH::Perl Version 1.25, protocol version 2.0. <hostname>: No compat match: 3.0.1 F-SECURE SSH I had a quick look through the code and it would seem F-Secure isn't checked for. So I put an entry in to match it, with a mask of zero, but the results were the same. Any other ideas? Thanks, Joe -----Original Message----- From: ssh...@li... [mailto:ssh...@li...] On Behalf Of Mihai Secasiu Sent: 12 December 2004 18:17 To: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Multiple operations in a single channel/shell? (Net::SSH) you can execute multiple commands on the same channel if you use SSH 2=20 On Friday 10 December 2004 13:03, Wildish, Joe wrote: > I originally thought that I could use Net::SSH::Perl to issue multiple > commands in the same shell. However, having looked into it a little=20 > more, it seems that this is not the default behaviour. I have done a=20 > little research, and it appears that a seperate channel is created=20 > each time the cmd method is called - which effectively creates a new=20 > shell. > > I am wanting to execute the commands in the same shell. For example: > > ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE"); > ($out2,$err2,$rc2) =3D $ssh->cmd("print $FOO"); > > $out2 would equal "WIBBLE".... > > I think I can probably achieve this behaviour by registering a handler > and iterating through each of the commands I want to issue within the=20 > subroutine, but this doesn't seem the nicest way. Ideally, if I could=20 > pass in the channel number to the cmd method, that would be cool... I=20 > am assuming of course that there are no problems with this approach? > > I was hoping people on this list may have come across this requirement > before, and could perhaps point me in the right direction .... (?) > > Regards, > Joe --=20 +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.=20 http://productguide.itmanagersjournal.com/ _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Mihai S. <mih...@de...> - 2004-12-13 10:33:14
|
Did you try creating the ssh object like this:=20 Net::SSH::Perl->new($domain,port =3D> $port,options =3D> ["Protocol 2"])) On Monday 13 December 2004 08:00, Andersson, Kimmo wrote: > Hi ! > > The documentation says so and You say so but that does not work. At least > the results are not what You want. > > I had a similar case. On a HP-UX machine I wanted to import an Oracle > export file which my Perl script had transferred using FTP. To use Import= I > have to setup the environment first (first command) using a shell script. > However I'm certain that SSH 2 was used but the environment settings were > lost while issuing the second command (import). > > To maintain the environment setting I had to chain the two commands into > one command. > Using Your example something like this: > ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE";"print $FOO";); > > That should work irrespective of the SSH version. > > BR Kimmo Andersson > Jyv=E4skyl=E4, Finland > > >you can execute multiple commands on the same channel if you use SSH 2 > > > >On Friday 10 December 2004 13:03, Wildish, Joe wrote: > >> I originally thought that I could use Net::SSH::Perl to issue multiple > >> commands in the same shell. However, having looked into it a little > >> more, it seems that this is not the default behaviour. I have done a > >> little research, and it appears that a seperate channel is created each > >> time the cmd method is called - which effectively creates a new shell. > >> > >> I am wanting to execute the commands in the same shell. For example: > >> > >> ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE"); > >> ($out2,$err2,$rc2) =3D $ssh->cmd("print $FOO"); > >> > >> $out2 would equal "WIBBLE".... > >> > >> I think I can probably achieve this behaviour by registering a handler > >> and iterating through each of the commands I want to issue within the > >> subroutine, but this doesn't seem the nicest way. Ideally, if I could > >> pass in the channel number to the cmd method, that would be cool... I = am > >> assuming of course that there are no problems with this approach? > >> > >> I was hoping people on this list may have come across this requirement > >> before, and could perhaps point me in the right direction .... (?) > >> > >> Regards, > >> Joe > > > >-- > >+----------------------------------------------------------------------- > > > >| Mihai Secasiu > >| http://denixsolutions.com/ > >| Complete Unix/Linux Solutions for your Business > > > >+----------------------------------------------------------------------- > > > > > >--__--__-- > > > >Message: 2 > >From: Mihai Secasiu <mih...@de...> > >Organization: Denix Solutions > >To: ssh...@li... > >Subject: Re: [Ssh-sftp-perl-users] Net::SFTP error handling - patch? > >Date: Sun, 12 Dec 2004 20:20:42 +0200 > > > >You can send the patch here, I will review it and merge it into the code. > > > >On Friday 10 December 2004 23:48, David Robins wrote: > >> I'd like to add some error handling with the result of having > >> Net::SFTP's put method return success (true)/failure (false), and > >> perhaps some other patches too: > >> > >> - similar return for 'get' (unless there's no local file specified, in > >> which case the file contents are returned) (as reported [not by me] > >> about > > > >a > > > >> year ago at http://rt.cpan.org/NoAuth/Bug.html?id=3D4610) - allow warn= ings > > > >to > > > >> be redirected to a callback (or turned off), defaulting to warn for > >> backwards compatibility > >> > >> If these seem like a good idea I'll write up and submit a patch (if I > >> do, where should I send it to, this list?) > >> > >> Thanks, > > > >-- > >+----------------------------------------------------------------------- > > > >| Mihai Secasiu > >| http://denixsolutions.com/ > >| Complete Unix/Linux Solutions for your Business > > > >+----------------------------------------------------------------------- > > > > > > > >--__--__-- > > > >_______________________________________________ > >Ssh-sftp-perl-users mailing list > >Ssh...@li... > >https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > > > > >End of Ssh-sftp-perl-users Digest =2D-=20 +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: Andersson, K. <Kim...@yo...> - 2004-12-13 06:00:56
|
Hi ! The documentation says so and You say so but that does not work. At = least the results are not what You want. I had a similar case. On a HP-UX machine I wanted to import an Oracle = export file which my Perl script had transferred using FTP. To use Import I = have to setup the environment first (first command) using a shell script. = However I'm certain that SSH 2 was used but the environment settings were lost = while issuing the second command (import). To maintain the environment setting I had to chain the two commands = into one command.=20 Using Your example something like this: ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE";"print $FOO";); That should work irrespective of the SSH version.=20 =20 BR Kimmo Andersson Jyv=E4skyl=E4, Finland >you can execute multiple commands on the same channel if you use SSH 2 >On Friday 10 December 2004 13:03, Wildish, Joe wrote: >> I originally thought that I could use Net::SSH::Perl to issue = multiple >> commands in the same shell. However, having looked into it a little >> more, it seems that this is not the default behaviour. I have done a >> little research, and it appears that a seperate channel is created = each >> time the cmd method is called - which effectively creates a new = shell. >> >> I am wanting to execute the commands in the same shell. For example: >> >> ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE"); >> ($out2,$err2,$rc2) =3D $ssh->cmd("print $FOO"); >> >> $out2 would equal "WIBBLE".... >> >> I think I can probably achieve this behaviour by registering a = handler >> and iterating through each of the commands I want to issue within = the >> subroutine, but this doesn't seem the nicest way. Ideally, if I = could >> pass in the channel number to the cmd method, that would be cool... = I am >> assuming of course that there are no problems with this approach? >> >> I was hoping people on this list may have come across this = requirement >> before, and could perhaps point me in the right direction .... (?) >> >> Regards, >> Joe > >-- >+----------------------------------------------------------------------= - >| Mihai Secasiu >| http://denixsolutions.com/ >| Complete Unix/Linux Solutions for your Business >+----------------------------------------------------------------------= - > > >--__--__-- > >Message: 2 >From: Mihai Secasiu <mih...@de...> >Organization: Denix Solutions >To: ssh...@li... >Subject: Re: [Ssh-sftp-perl-users] Net::SFTP error handling - patch? >Date: Sun, 12 Dec 2004 20:20:42 +0200 > >You can send the patch here, I will review it and merge it into the = code. >On Friday 10 December 2004 23:48, David Robins wrote: >> I'd like to add some error handling with the result of having = Net::SFTP's >> put method return success (true)/failure (false), and perhaps some = other >> patches too: >> >> - similar return for 'get' (unless there's no local file specified, = in >> which case the file contents are returned) (as reported [not by me] = about >a >> year ago at http://rt.cpan.org/NoAuth/Bug.html?id=3D4610) - allow = warnings >to >> be redirected to a callback (or turned off), defaulting to warn for >> backwards compatibility >> >> If these seem like a good idea I'll write up and submit a patch (if = I do, >> where should I send it to, this list?) >> >> Thanks, > >-- >+----------------------------------------------------------------------= - >| Mihai Secasiu >| http://denixsolutions.com/ >| Complete Unix/Linux Solutions for your Business >+----------------------------------------------------------------------= - > > > >--__--__-- > >_______________________________________________ >Ssh-sftp-perl-users mailing list >Ssh...@li... >https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > >End of Ssh-sftp-perl-users Digest |
From: Mihai S. <mih...@de...> - 2004-12-12 18:20:28
|
You can send the patch here, I will review it and merge it into the code. On Friday 10 December 2004 23:48, David Robins wrote: > I'd like to add some error handling with the result of having Net::SFTP's > put method return success (true)/failure (false), and perhaps some other > patches too: > > - similar return for 'get' (unless there's no local file specified, in > which case the file contents are returned) (as reported [not by me] about a > year ago at http://rt.cpan.org/NoAuth/Bug.html?id=4610) - allow warnings to > be redirected to a callback (or turned off), defaulting to warn for > backwards compatibility > > If these seem like a good idea I'll write up and submit a patch (if I do, > where should I send it to, this list?) > > Thanks, -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: Mihai S. <mih...@de...> - 2004-12-12 18:16:52
|
you can execute multiple commands on the same channel if you use SSH 2 On Friday 10 December 2004 13:03, Wildish, Joe wrote: > I originally thought that I could use Net::SSH::Perl to issue multiple > commands in the same shell. However, having looked into it a little > more, it seems that this is not the default behaviour. I have done a > little research, and it appears that a seperate channel is created each > time the cmd method is called - which effectively creates a new shell. > > I am wanting to execute the commands in the same shell. For example: > > ($out,$err,$rc) = $ssh->cmd("export FOO=WIBBLE"); > ($out2,$err2,$rc2) = $ssh->cmd("print $FOO"); > > $out2 would equal "WIBBLE".... > > I think I can probably achieve this behaviour by registering a handler > and iterating through each of the commands I want to issue within the > subroutine, but this doesn't seem the nicest way. Ideally, if I could > pass in the channel number to the cmd method, that would be cool... I am > assuming of course that there are no problems with this approach? > > I was hoping people on this list may have come across this requirement > before, and could perhaps point me in the right direction .... (?) > > Regards, > Joe -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: David R. <dr...@at...> - 2004-12-10 22:13:20
|
I've been delving into the guts of Net::SFTP, Net::SSH::Perl, and = Math::Pari to find out why 'ls' overflows the PARI stack (e.g. = http://www.codecomments.com/message237191.html), and believe I have a = fix. The leak is in Net::SSH::Perl::Util::SSH2MP::bin2mp; when it = creates a Math::Pari 64-bit int for the file size (via = Net::SFTP::Attributes::init and Net::SFTP::Buffer::get_int64): sub bin2mp { my $s =3D shift; my $p =3D PARI(0); for my $b (split //, $s) { $p =3D $p * 256 + ord $b; } $p; } the '256', through no fault of the code, leaks about 12 bytes for each = file listed (I wrote a Math::Pari::dumpStack to check and then moved the = 256 to a $base =3D PARI(256) outside the loop as is done in mp2bin to = check this), so it becomes: sub bin2mp { my $s =3D shift; my $p =3D PARI(0); my $base =3D PARI(256); for my $b (split //, $s) { $p =3D $p * $base + ord $b; } $p; } While this doesn't solve the underlying problem (Math::Pari constants = shouldn't leak), it's a small patch for a decent gain. I will continue = to look into Math::Pari to see if I can fix the underlying problem. For = now, if someone's actively having problems, they can apply my fix = themselves. Problem is reproducible on perl 5.5.3 and 5.8.5, with a simple = connection and looped ls, e.g. (*) perl -MNet::SFTP -we = '$ftp=3DNet::SFTP->new(...connection params...); $ftp->ls("/some/dir") = while 1' (the more files in the dir, the less iterations it takes). * NOTE: do NOT use -l, Net::SSH::Perl is sensitive to it for = transmission - should this be considered a bug? Should I send a patch to this list? Thanks, --=20 Dave Isa. 40:31 |
From: David R. <dr...@at...> - 2004-12-10 21:48:48
|
I'd like to add some error handling with the result of having = Net::SFTP's put method return success (true)/failure (false), and = perhaps some other patches too: - similar return for 'get' (unless there's no local file specified, in = which case the file contents are returned) (as reported [not by me] = about a year ago at http://rt.cpan.org/NoAuth/Bug.html?id=3D4610) - allow warnings to be redirected to a callback (or turned off), = defaulting to warn for backwards compatibility If these seem like a good idea I'll write up and submit a patch (if I = do, where should I send it to, this list?) Thanks, --=20 Dave Isa. 40:31 |
From: Wildish, J. <Joe...@ca...> - 2004-12-10 11:03:45
|
I originally thought that I could use Net::SSH::Perl to issue multiple commands in the same shell. However, having looked into it a little more, it seems that this is not the default behaviour. I have done a little research, and it appears that a seperate channel is created each time the cmd method is called - which effectively creates a new shell. I am wanting to execute the commands in the same shell. For example: ($out,$err,$rc) =3D $ssh->cmd("export FOO=3DWIBBLE"); ($out2,$err2,$rc2) =3D $ssh->cmd("print $FOO"); $out2 would equal "WIBBLE".... I think I can probably achieve this behaviour by registering a handler and iterating through each of the commands I want to issue within the subroutine, but this doesn't seem the nicest way. Ideally, if I could pass in the channel number to the cmd method, that would be cool... I am assuming of course that there are no problems with this approach? I was hoping people on this list may have come across this requirement before, and could perhaps point me in the right direction .... (?) Regards, Joe |
From: Ed D. <eda...@gm...> - 2004-12-07 23:20:16
|
I am trying to connect to a host using Net::SSH::Perl and am getting the following debug info and error: myhost: Reading configuration data /home/bfdi533/.ssh/config myhost: Reading configuration data /etc/ssh_config myhost: Connecting to 1.2.3.4, port 22. myhost: Remote protocol version 2.0, remote software version OpenSSH_2.9p2 myhost: Net::SSH::Perl Version 1.25, protocol version 2.0. myhost: No compat match: OpenSSH_2.9p2. myhost: Connection established. myhost: Sent key-exchange init (KEXINIT), wait response. myhost: Algorithms, c->s: 3des-cbc hmac-sha1 none myhost: Algorithms, s->c: 3des-cbc hmac-sha1 none myhost: Entering Diffie-Hellman Group 1 key exchange. myhost: Sent DH public key, waiting for reply. Received disconnect message: at /usr/lib/perl5/vendor_perl/5.8.4/Net/SSH/Perl/Kex/DH1.pm line 41 Any ideas on where to start to get this working? -- - Ed Davison |
From: Mihai S. <mih...@de...> - 2004-12-04 18:48:45
|
On Friday 03 December 2004 19:43, Murali Pandurangi wrote: > I am trying to use the SFTP PERL Mod and I have a question to ask you on > the same. > > The scenario is; > > 1. there is a Win2003 Server with some secure files and I have PERL on a > second Windows 2003 box. > 2. I need to make a secure transaction to get the file from the first > box to the second box. > 3. I need to install PERL NET::sftp on the second W2003 box so as to > execute the PERL script and the sftp mod. > 4. My concern is what do I need on the first W2003 box where the secure > files are so that the PERL->sftp transaction from the second box is > understood > and the secure tunnel is established? Should I have SSH? Should I > have sftp running as a service? Should I have PERL installed with > NET::sftp on the second box too? Where can I get an sftp.exe for free? You need a SSH server that supports SFTP on the first box, I don't know of any free SSH server for windows but you may use OpenSSH installed over cygwin -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: Murali P. <mpa...@pb...> - 2004-12-03 17:43:15
|
I am trying to use the SFTP PERL Mod and I have a question to ask you on the same. The scenario is; 1. there is a Win2003 Server with some secure files and I have PERL on a second Windows 2003 box. 2. I need to make a secure transaction to get the file from the first box to the second box. 3. I need to install PERL NET::sftp on the second W2003 box so as to execute the PERL script and the sftp mod. 4. My concern is what do I need on the first W2003 box where the secure files are so that the PERL->sftp transaction from the second box is understood and the secure tunnel is established? Should I have SSH? Should I have sftp running as a service? Should I have PERL installed with NET::sftp on the second box too? Where can I get an sftp.exe for free? -- murali PANDURANGI |