ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 37)
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: Lee, P. K <Phi...@ba...> - 2004-05-26 14:15:38
|
am trying out the example in the module eg/remoteinteract2.pl and it did not work.=20 =20 I got this error message straight away: =20 $ perl original.pl cr-dev1: Reading configuration data /export/home/plee/.ssh/config cr-dev1: Reading configuration data /etc/ssh_config cr-dev1: Connecting to cr-jumpstart, port 22. cr-dev1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p1 cr-dev1: Net::SSH::Perl Version 1.25, protocol version 2.0. cr-dev1: No compat match: OpenSSH_3.7.1p1. cr-dev1: Connection established. cr-dev1: Sent key-exchange init (KEXINIT), wait response. cr-dev1: Algorithms, c->s: 3des-cbc hmac-sha1 none cr-dev1: Algorithms, s->c: 3des-cbc hmac-sha1 none cr-dev1: Entering Diffie-Hellman Group 1 key exchange. cr-dev1: Sent DH public key, waiting for reply. cr-dev1: Received host key, type 'ssh-dss'. cr-dev1: Host 'cr-jumpstart' is known and matches the host key. cr-dev1: Computing shared secret key. cr-dev1: Verifying server signature. cr-dev1: Waiting for NEWKEYS message. cr-dev1: Enabling incoming encryption/MAC/compression. cr-dev1: Send NEWKEYS, enable outgoing encryption/MAC/compression. cr-dev1: Sending request for user-authentication service. cr-dev1: Service accepted: ssh-userauth. cr-dev1: Trying empty user-authentication request. cr-dev1: Authentication methods that can continue: publickey,password,keyboard-interactive. cr-dev1: Next method to try is publickey. cr-dev1: Next method to try is password. cr-dev1: Trying password authentication. cr-dev1: Login completed, opening dummy shell channel. cr-dev1: channel 0: new [client-session] cr-dev1: Requesting channel_open for channel 0. cr-dev1: channel 0: open confirm rwindow 0 rmax 32768 cr-dev1: Got channel open confirmation, requesting shell. cr-dev1: Requesting service shell on channel 0. cr-dev1: channel 1: new [client-session] cr-dev1: Requesting channel_open for channel 1. cr-dev1: Entering interactive session. cr-dev1: Sending command: passwd plee cr-dev1: Requesting service exec on channel 1. cr-dev1: channel 1: open confirm rwindow 0 rmax 32768 cr-dev1: input_channel_request: rtype exit-status reply 0 cr-dev1: channel 1: rcvd eof cr-dev1: channel 1: output open -> drain cr-dev1: channel 1: rcvd close cr-dev1: channel 1: input open -> closed cr-dev1: channel 1: close_read STDERR: Permission denied =20 cr-dev1: channel 1: obuf empty cr-dev1: channel 1: output drain -> closed cr-dev1: channel 1: close_write cr-dev1: channel 1: send close cr-dev1: channel 1: full closed $ I printed the $buffer->bytes in the register-handler sub routine for the STDERR. Why do i get the error message straight away instead of the prompt?? I am running Solaris 8 on sparc machine. =20 ____________________________ Philip Lee International: +44 20 8760 6633 Internal: 66633 =20 Notice to recipient: The information in this internet e-mail and any attachments is = confidential and may be privileged. It is intended solely for the = addressee. If you are not the intended addressee please notify the = sender immediately by telephone. If you are not the intended recipient, = any disclosure, copying, distribution or any action taken or omitted to = be taken in reliance on it, is prohibited and may be unlawful. When addressed to external clients any opinions or advice contained in = this internet e-mail are subject to the terms and conditions expressed = in any applicable governing terms of business or client engagement = letter issued by the pertinent Bank of America group entity. If this email originates from the U.K. please note that Bank of America, = N.A., London Branch, Banc of America Securities Limited and Banc of = America Futures Incorporated are regulated by the Financial Services = Authority. |
From: Dave R. <au...@ur...> - 2004-05-20 19:58:36
|
On Thu, 20 May 2004, David Bruce wrote: > use Net::SSH::Perl; > > my $ssh = Net::SSH::Perl->new($host, options => ['protocol 2']); This could (and probably should) be written as my $ssh = Net::SSH::Perl->new($host, protocol => 2); I don't think setting the protocol via an option will work, since it has to be known during object creation to work. > $ssh->login($user, $pass); > > my($stdout, $stderr, $exit) = $ssh->cmd($cmd); > print $stdout; > > Error: > Argument "ssh-rsa" isn't numeric in numeric eq (==) at > /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl/Key/RSA1.pm line 94, <FH> > line 15 This shouldn't be a fatal error, but I think it may be a bug in the code. Grr, if it only had a test suite ... -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: David B. <db...@ua...> - 2004-05-20 19:33:59
|
Hi! I'm having some difficulty using Net::SSH::Perl against a specific host. The following code works fine against a Red Hat machine I have, but when I try to point it at our Packeteer and run it with -w, I get the error below and then the script hangs indefinitely. I know for a fact it never executes the command since I have asked it to to execute something that would leave a trace and there was no trace. #!/usr/bin/perl use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($host, options => ['protocol 2']); my $cmd = 'ls -al'; $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout; Error: Argument "ssh-rsa" isn't numeric in numeric eq (==) at /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl/Key/RSA1.pm line 94, <FH> line 15 Any ideas? Please reply directly to me, since I don't receive the list. Thanks, David Bruce Network Services Computing Service University of Arkansas (479) 575-2905 |
From: Martin M. <m.m...@cg...> - 2004-05-11 00:01:45
|
I had the same problem... With the tip from Dave, I was able to go around the problem using utf8::downgrade... my get now works!!! Thanks Martin Masson use utf8; no utf8; $remotefile = $currentpath."/".$file->{filename}; utf8::downgrade($remotefile); $sftp->get($remotefile,$transferpath."/".$file->{filename}); |
From: Dave R. <au...@ur...> - 2004-04-19 18:09:52
|
So the big thing holding back changes to the code, including bug fixes, error handling, etc., is that there is no good test suite currently. The current tests don't exercise even a fraction of the core code (particularly the SSH2 bits, which make up the bulk of Net::SSH). So I'm looking for ideas on this. It's ok if the tests can only run on a developer's machine, as long as they can run before making a release. If they could run on other machines reliably, that's a nice bonus ;) I'm thinking that it could do something like this: - Create a known file system layout (important for SFTP tests, obviously, but also useful for SSH, I'd think) - Start an SSH daemon on a high-numbered port, chrooted into that filesystem. - Do some tests - Restart SSH daemon as needed with different options, config, etc. Does that sound reasonable? Help implementing or designing or anything would be greatly appreciated. Once there's a test suite, I can start actually changing the code. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Stephen N. <st...@st...> - 2004-04-19 16:03:00
|
Hello, I'm trying to use Net::SFTP against an SFTP-only server (doesn't do SSH shell access, only SFTP). The server expects commands on the first channel you connect on (channel 0), but whenever I connect with Net::SFTP, it always sends commands over a second channel (channel 1). This appears to be happening because Net::SSH::Perl opens up a "dummy" shell connection on the first channel. Since the SFTP server is waiting for commands on channel 0, I can't get any further than authentication. I've tried commenting out the code in Net::SSH:Perl which opens a channel after authentication, in the hopes that Net::SFTP's new connection will be channel 0. This works to a point (Net::SFTP's connection is indeed channel 0), but as soon as Net::SFTP issues an SSH2_FXP_INIT command, the program dies with the following errors: Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.1/Net/SSH/Perl/Channel.pm line 85. Use of uninitialized value in pack at /usr/local/lib/perl5/site_perl/5.8.1/Net/SSH/Perl/Buffer.pm line 105. Connection closed at netsftptest.pl line 22 Connecting to the SFTP server with OpenSSH's SFTP client works correctly. The client opens up only the single channel 0 connection, and is able to fully connect to the server without a problem. Is there any way to get Net::SFTP/Net::SSH::Perl to do the same thing? Thanks in advance! --Steve |
From: Mark F. <mar...@ea...> - 2004-04-03 07:23:34
|
Dave, I have entered the "rt". I appreciate your taking ownership/support of these modules and I didn't intend to diminish that generosity. I was just frustrated that something as easy as updating the documentation with an example (as discussed in an email last November?, and a posting to the mailing list a few months later) was delayed this long. If I was supposed to make a more formal request I didn't realize it. Frankly, I don't know how I figured out how the ssh-parms worked and I feel sorry for anyone who has to repeat the exericise. You didn't create it that way. But, after discovering it, it seems like just documenting it would be a huge step forward. It's in "rt" now. I'm sorry if I was disrespectful of your volunteer role. I'm eager to help any way I can. Mark ----- Original Message ----- From: "Dave Rolsky" <au...@ur...> To: "Mark Fuller" <mar...@ea...> Cc: "Vitali Cesare" <CV...@me...>; <ssh...@li...> Sent: Saturday, April 03, 2004 12:03 AM Subject: Re: [Ssh-sftp-perl-users] Change port used in Net::SFTP > On Fri, 2 Apr 2004, Mark Fuller wrote: > > > I don't know what an "RT ticket" is. :) I'm sorry if my bad day came through > > On rt.cpan.org, that's where I check for stuff to do for modules I > maintain. > > > If I need to do something formal, tell me what to do. I know it was this way > > before you tookover support. I'm sorry if I came on too strong. It just > > needs an example in the POD. > > Well, I think what these modules need is a maintainer who uses them > regularly _and_ understands the protocols involved. I took them over > mainly because I wanted to fix the memory leaking/handle persistence > problems so it would be more usable for Bricolage, but I don't really need > them to do anything beyond that, and I can't even answer many of the > questions people have about the finer details of their usage. > > So if anyone reading this is really motivated, I'd be happy to give you > access to the SF project. I can still do the CPAN release bits if people > want, or I can give someone else CPAN co-maintainership. > > > -dave > > /*======================= > House Absolute Consulting > www.houseabsolute.com > =======================*/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Dave R. <au...@ur...> - 2004-04-03 07:03:12
|
On Fri, 2 Apr 2004, Mark Fuller wrote: > I don't know what an "RT ticket" is. :) I'm sorry if my bad day came through On rt.cpan.org, that's where I check for stuff to do for modules I maintain. > If I need to do something formal, tell me what to do. I know it was this way > before you tookover support. I'm sorry if I came on too strong. It just > needs an example in the POD. Well, I think what these modules need is a maintainer who uses them regularly _and_ understands the protocols involved. I took them over mainly because I wanted to fix the memory leaking/handle persistence problems so it would be more usable for Bricolage, but I don't really need them to do anything beyond that, and I can't even answer many of the questions people have about the finer details of their usage. So if anyone reading this is really motivated, I'd be happy to give you access to the SF project. I can still do the CPAN release bits if people want, or I can give someone else CPAN co-maintainership. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mark F. <mar...@ea...> - 2004-04-03 07:00:01
|
I don't know what an "RT ticket" is. :) I'm sorry if my bad day came through in that email. But, if the ssh-args parm isn't going to change anytime soon, I think the convoluted usage should be exampled. The convoluted thing isn't too bad if it's just documented with an example. I know I've mentioned it a couple of times. One of which should be in the archives (which seem to be unavailable at the moment). If I need to do something formal, tell me what to do. I know it was this way before you tookover support. I'm sorry if I came on too strong. It just needs an example in the POD. Mark ----- Original Message ----- From: "Dave Rolsky" <au...@ur...> To: "Mark Fuller" <mar...@ea...> Cc: "Vitali Cesare" <CV...@me...>; <ssh...@li...> Sent: Friday, April 02, 2004 11:48 PM Subject: Re: [Ssh-sftp-perl-users] Change port used in Net::SFTP > On Fri, 2 Apr 2004, Mark Fuller wrote: > > > Dave, I asked you *6 months ago* to add an example to the POD. You keep > > Wow, was it that long? > > > saying it shouldn't work this way. Until it doesn't work this way, wouldn't > > it be helpful to document how it works now? It took me *two days* to figure > > out how to do the above. It seems other users have the same challenge. Why > > not just add it to the POD so we don't have to suffer with it any more? I > > don't think it's a problem how convoluted it is. Just that it's not > > documented -- and apparently no interest in documenting it. > > Hey, don't blame me! It wasn't documented when I got this thing. But > yes, it should be documented. Is there an RT ticket for this? > > > -dave > > /*======================= > House Absolute Consulting > www.houseabsolute.com > =======================*/ |
From: Dave R. <au...@ur...> - 2004-04-03 06:48:51
|
On Fri, 2 Apr 2004, Mark Fuller wrote: > Dave, I asked you *6 months ago* to add an example to the POD. You keep Wow, was it that long? > saying it shouldn't work this way. Until it doesn't work this way, wouldn't > it be helpful to document how it works now? It took me *two days* to figure > out how to do the above. It seems other users have the same challenge. Why > not just add it to the POD so we don't have to suffer with it any more? I > don't think it's a problem how convoluted it is. Just that it's not > documented -- and apparently no interest in documenting it. Hey, don't blame me! It wasn't documented when I got this thing. But yes, it should be documented. Is there an RT ticket for this? -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mark F. <mar...@ea...> - 2004-04-03 06:40:12
|
You want to use the "ssh args" part of the net::sftp "new" method. This is where you can specify parms to net::ssh::perl. Unfortunately, it is as clear as *mud* how to do this. my $sftp = Net::SFTP->new('somehost.domain.domain', ( user => 'someuser', ssh_args => ( ( [port => (['1234']) ] ) ) ) ); Dave, I asked you *6 months ago* to add an example to the POD. You keep saying it shouldn't work this way. Until it doesn't work this way, wouldn't it be helpful to document how it works now? It took me *two days* to figure out how to do the above. It seems other users have the same challenge. Why not just add it to the POD so we don't have to suffer with it any more? I don't think it's a problem how convoluted it is. Just that it's not documented -- and apparently no interest in documenting it. Mark ----- Original Message ----- From: "Vitali Cesare" <CV...@me...> To: <ssh...@li...> Sent: Friday, April 02, 2004 2:30 AM Subject: [Ssh-sftp-perl-users] Change port used in Net::SFTP Hi to all, I need to get a file on a server that use a non-standard port for ssh daemon, 222, but I don't find a way to specify it on create of connection my $sftp = Net::SFTP->new($host, $user, $passw) or die "Cannot connect to host : $host \n" ; There is a way to specify it in the module Net::SFTP, like in Net::SSH::W32Perl my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => 2) Many thanks for your time Best regards Cesare ------------------------ Cesare Vitali ------------------------ Met Sogeda S.p.A. ------------------------ mailto:cv...@so... Sistemista Microsoft HP Certified Engineer ------------------------ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Vitali C. <CV...@me...> - 2004-04-02 09:28:08
|
Hi to all, I need to get a file on a server that use a non-standard port for ssh daemon, 222, but I don't find a way to specify it on create of connection my $sftp =3D Net::SFTP->new($host, $user, $passw) or die "Cannot connect to host : $host \n" ; There is a way to specify it in the module Net::SFTP, like in Net::SSH::W32Perl my $ssh =3D new Net::SSH::W32Perl($host, port =3D> 22, debug =3D> 1, = protocol =3D> 2) Many thanks for your time Best regards Cesare ------------------------ Cesare Vitali ------------------------ Met Sogeda S.p.A. ------------------------ mailto:cv...@so... Sistemista Microsoft=20 HP Certified Engineer ------------------------=20 |
From: John S. <js...@st...> - 2004-03-30 17:26:30
|
We have setup some of our hosts to use PAM authentication for ssh. For these hosts, Net::SSH::Perl does not pass through the password and instead prompts for a "password". Is there any way to correct this? Thanks. Below is an example, note the " Doing challenge response authentication. Password" myhost: Reading configuration data /root/.ssh/config myhost: Reading configuration data /etc/ssh_config myhost: Allocated local port 1023. myhost: Connecting to myremotehost, port 22. myhost: Remote protocol version 1.99, remote software version OpenSSH_3.8p1 myhost: Net::SSH::Perl Version 1.25, protocol version 1.5. myhost: No compat match: OpenSSH_3.8p1. myhost: Connection established. myhost: Waiting for server public key. myhost: Received server public key (768 bits) and host key (1024 bits). myhost: Host 'myremotehost' is known and matches the host key. myhost: Encryption type: DES3 myhost: Sent encrypted session key. myhost: Received encryption confirmation. myhost: RSA authentication failed: Can't load public key. myhost: Doing challenge response authentication. Password: myhost: Sending command: hostname myhost: Entering interactive session. |
From: Rishi K. M <kau...@in...> - 2004-03-24 10:27:45
|
Hi Mark, The result is same when I used Net::SSH::Perl instaead of W32Perl. I have commented out the "fcntl" call in C:\Perl\Site\lib\Net\SSH\Perl.pm to work proprely in my windows PC. When I say $ssh->cmd("ls -al > x") in my code, this command got executed on the remote host. But prgram is getting stucked there and not executing the next perl instructions in the file. If possible, please let me know why the program is getting stucked at $ssh->cmd. Thanks & Regards, Rishi -----Original Message----- From: Mark A. Fuller [mailto:mar...@ea...] Sent: Tuesday, March 23, 2004 11:18 PM To: Rishi Kaundinya M; 'Mark A. Fuller'; ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Rishi, It's hard to say since you are using Net::SSH::W32Perl which is a clone of Net::SSH::Perl from 2 years ago. Did you try contacting the maintainer of it? Did you try using Net::SSH::Perl to see if it exhibits the same problem? Assuming they are not too disimiliar, what do you get from ($out, $err, $exit) returned from the cmd method? Anything? I would try the shell method and do some things interactively to see if it behaves differently. It sounds like you're saying any commands fail. First it was "ls". Now "exit"? Do any commands work? Have you tried using a native SSH (binary like openSSH) just to see if you can get ssh to work this way? (rule out the possibility it's something wrong with the sshd server). But again, you're using a distribution that may be significantly different from Net::SSH::Perl. Mark -----Original Message----- From: Rishi Kaundinya M <kau...@in...> Sent: Mar 23, 2004 9:50 AM To: "'Mark A. Fuller'" <mar...@ea...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Mark, I have written small test program as follows. ========================================================================= use Net::SSH::W32Perl; my $host = 'sama.india.hp.com'; my $cmd="ls -al "; my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => 2); $ssh->login(Rishi, xxxxx); $ssh->cmd("exit"); print "\n Hi Rishi"; ============================================================================ ========== I got the following output. As you see the the program is not terminating and the I am not seeing "Hi Rishi" in the standard output. The program got stuck at the following point. <snip> channel 1: open confirm rwindow 0 rmax 32768 </snip> Can you please tell me what I need to do inorder the control to reach to print statement following $ssh->cmd("exit"). I am facing the same behaviour even though I did regoster_handler for the commands. I got stucked at this point in my project and need this information urgently. I appreciate your help in this regard. ============================================================================ =========== D:\Projects\console_logger\SSH\Test>perl ex1.pl eb96140: Reading configuration data /.ssh/config eb96140: Reading configuration data /etc/ssh_config eb96140: Connecting to sama.india.hp.com, port 22. eb96140: Socket created, turning on blocking... eb96140: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2-pw exp26 eb96140: Net::SSH::Perl Version 1.25, protocol version 2.0. eb96140: No compat match: OpenSSH_3.7.1p2-pwexp26. eb96140: Connection established. eb96140: Sent key-exchange init (KEXINIT), wait response. eb96140: Algorithms, c->s: 3des-cbc hmac-sha1 none eb96140: Algorithms, s->c: 3des-cbc hmac-sha1 none eb96140: Entering Diffie-Hellman Group 1 key exchange. eb96140: Sent DH public key, waiting for reply. eb96140: Received host key, type 'ssh-dss'. eb96140: Computing shared secret key. eb96140: Verifying server signature. eb96140: Waiting for NEWKEYS message. eb96140: Enabling incoming encryption/MAC/compression. eb96140: Send NEWKEYS, enable outgoing encryption/MAC/compression. eb96140: Sending request for user-authentication service. eb96140: Service accepted: ssh-userauth. eb96140: Trying empty user-authentication request. eb96140: Authentication methods that can continue: publickey,password,keyboard-i nteractive. eb96140: Next method to try is publickey. eb96140: Next method to try is password. eb96140: Trying password authentication. eb96140: Login completed, opening dummy shell channel. eb96140: channel 0: new [client-session] eb96140: Requesting channel_open for channel 0. eb96140: channel 0: open confirm rwindow 0 rmax 32768 eb96140: Got channel open confirmation, requesting shell. eb96140: Requesting service shell on channel 0. eb96140: channel 1: new [client-session] eb96140: Requesting channel_open for channel 1. eb96140: Entering interactive session. eb96140: Sending command: exit eb96140: Requesting service exec on channel 1. eb96140: channel 1: open confirm rwindow 0 rmax 32768 ============================================================================ ====== Thanks & Regards, Rishi -----Original Message----- From: ssh...@li... [mailto:ssh...@li...]On Behalf Of Mark A. Fuller Sent: Tuesday, March 23, 2004 9:28 PM To: Rishi Kaundinya M; 'Mark Fuller'; ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Rishi, regarding question #4, I think "exit" would be an appropriate way to terminate the secure shell. You're telling the remote host you're exiting and it will close the connection? Regarding your other questions: how different is Net::SSH::W32Perl? I just read about it on CPAN and it says it is a copy of Net::SSH::Perl from early 2002. Maybe it behaves differently? Have you tried to contact the author (Scott Scecina, as listed on the CPAN page)? You could try the same commands using Net::SSH::Perl and see if it fails too. Mark -----Original Message----- From: Rishi Kaundinya M <kau...@in...> Sent: Mar 23, 2004 7:26 AM To: 'Mark Fuller' <mar...@ea...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Mark, Thanks for the reply. Can you tell me why I am unable capture the output of "ls -al" in $out. Also after executing ssh->cmd, the code is stucking and the control is not going to the next statement following $ssh->cmd. Can you explain what I need to do for the script to contrinue executing all the instructions. Regards, Rishi -----Original Message----- From: Mark Fuller [mailto:mar...@ea...] Sent: Tuesday, March 23, 2004 7:38 PM To: Rishi Kaundinya M; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package I think what you are asking is how to trap errors and handle them without the script terminating? I had the same problem with Net::SFTP which uses the SSH module. My solution is described in a previous posting which can be found in the archive. http://sourceforge.net/mailarchive/forum.php?thread_id=3823363&forum_id=3651 4 You can process the @warnings array and take actions based on errors you recognize. Retry and write failures to a log, etc. Mark ----- Original Message ----- From: "Rishi Kaundinya M" <kau...@in...> To: <ssh...@li...> Sent: Tuesday, March 23, 2004 6:41 AM Subject: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package > > > -----Original Message----- > From: Rishi Kaundinya M [mailto:kau...@in...] > Sent: Tuesday, March 23, 2004 6:51 PM > To: 'ssh...@li...' > Subject: (Urgent) Information required on Net::SSH::W32Perl package > > Hi, > > I will appreciate your help in this regard. > > The requirement I have currently is as follows. > > Connect to a remote machine and based on the output of previous command > excute other commands. All the outputs will be stored in a local folder > in windows machine. I will be using perl2exe to generate final binary > out of my perl script. > > I have written a script as follows. > > ========================================================== > use Net::SSH::W32Perl; > > my $host = 'sama.india.hp.com'; > my $cmd="ls -al"; > my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => > 2); > $ssh->login(Rishi, XXXXX); > > #print "Hello \n", $str; > > $ssh->register_handler("stderr", sub { > my($channel, $buffer) = @_; > my $str = $buffer->bytes; > > print "\n How are you?"; > print "\n $str"; > exit; > > }); > > my ($out, $ err, $exit) = $ssh->cmd($cmd); > $ssh->cmd("exit"); > ============================================== > > I need following clarrification from you. > > 1. How can I detect the failure of login. I have seen following message > from the o/p of above code. > > "Permission denied at ex1.pl line 7". But I am going to lauch the > perl2exe > binary as daemon which don't have the terminal interaction. So please > let me know > how to detect the login failure. > > 2. I got stucked at the following point and unable to capture the output > of " ls -al" > in $out. I got following output while running the above code. > > eb96140: Next method to try is publickey. > eb96140: Next method to try is password. > eb96140: Trying password authentication. > eb96140: Login completed, opening dummy shell channel. > eb96140: channel 0: new [client-session] > eb96140: Requesting channel_open for channel 0. > eb96140: channel 0: open confirm rwindow 0 rmax 32768 > eb96140: Got channel open confirmation, requesting shell. > eb96140: Requesting service shell on channel 0. > eb96140: channel 1: new [client-session] > eb96140: Requesting channel_open for channel 1. > eb96140: Entering interactive session. > eb96140: Sending command: ls -al > eb96140: Requesting service exec on channel 1. > eb96140: channel 1: open confirm rwindow 0 rmax 32768 > > Where the program is stcued at the above point. Please let me know > how to get the output ls -al on sama in my windows script. > > Also code seems to not entring into the sub routine registered. > Please let me know what I need to do to solve the problem. > I am facing the same problem when I removed the "register_handler" > from my program. > > > 3. Is it possible to execute dependent commands (like cd followed ls -al) > from > my windows PC using ssh2 package. If so, can you please send me an > example code. > > 4. How to terminate the SSH session. Something like ssh->close is > available? > > Thanks in advance for your help, > > Regards, > Rishi > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Mark A. F. <mar...@ea...> - 2004-03-23 21:32:02
|
I followed a link to Scott Scecina's home page. http://www.soulcage.net/ppds/ He seems to be actively supporting the W32Perl fork. Maybe he would be willing to join forces and commonize the source? His email address is 2/3s down his home page. Mark -----Original Message----- From: Dave Rolsky <au...@ur...> Sent: Mar 23, 2004 2:14 PM To: "Mark A. Fuller" <mar...@ea...> Cc: Rishi Kaundinya M <kau...@in...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package On Tue, 23 Mar 2004, Mark A. Fuller wrote: > Regarding your other questions: how different is Net::SSH::W32Perl? I > just read about it on CPAN and it says it is a copy of Net::SSH::Perl > from early 2002. Maybe it behaves differently? Have you tried to contact > the author (Scott Scecina, as listed on the CPAN page)? You could try > the same commands using Net::SSH::Perl and see if it fails too. Looking at the source of the W32Perl module it's actually just a very thing subclass that just does SSH2 connections. I'd welcome patches from someone to integrate this so that Net::SSH::Perl just works right on Win32 (anyone?). -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Dave R. <au...@ur...> - 2004-03-23 21:14:46
|
On Tue, 23 Mar 2004, Mark A. Fuller wrote: > Regarding your other questions: how different is Net::SSH::W32Perl? I > just read about it on CPAN and it says it is a copy of Net::SSH::Perl > from early 2002. Maybe it behaves differently? Have you tried to contact > the author (Scott Scecina, as listed on the CPAN page)? You could try > the same commands using Net::SSH::Perl and see if it fails too. Looking at the source of the W32Perl module it's actually just a very thing subclass that just does SSH2 connections. I'd welcome patches from someone to integrate this so that Net::SSH::Perl just works right on Win32 (anyone?). -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mark A. F. <mar...@ea...> - 2004-03-23 17:49:38
|
Hi Rishi, It's hard to say since you are using Net::SSH::W32Perl which is a clone of Net::SSH::Perl from 2 years ago. Did you try contacting the maintainer of it? Did you try using Net::SSH::Perl to see if it exhibits the same problem? Assuming they are not too disimiliar, what do you get from ($out, $err, $exit) returned from the cmd method? Anything? I would try the shell method and do some things interactively to see if it behaves differently. It sounds like you're saying any commands fail. First it was "ls". Now "exit"? Do any commands work? Have you tried using a native SSH (binary like openSSH) just to see if you can get ssh to work this way? (rule out the possibility it's something wrong with the sshd server). But again, you're using a distribution that may be significantly different from Net::SSH::Perl. Mark -----Original Message----- From: Rishi Kaundinya M <kau...@in...> Sent: Mar 23, 2004 9:50 AM To: "'Mark A. Fuller'" <mar...@ea...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Mark, I have written small test program as follows. ========================================================================= use Net::SSH::W32Perl; my $host = 'sama.india.hp.com'; my $cmd="ls -al "; my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => 2); $ssh->login(Rishi, xxxxx); $ssh->cmd("exit"); print "\n Hi Rishi"; ============================================================================ ========== I got the following output. As you see the the program is not terminating and the I am not seeing "Hi Rishi" in the standard output. The program got stuck at the following point. <snip> channel 1: open confirm rwindow 0 rmax 32768 </snip> Can you please tell me what I need to do inorder the control to reach to print statement following $ssh->cmd("exit"). I am facing the same behaviour even though I did regoster_handler for the commands. I got stucked at this point in my project and need this information urgently. I appreciate your help in this regard. ============================================================================ =========== D:\Projects\console_logger\SSH\Test>perl ex1.pl eb96140: Reading configuration data /.ssh/config eb96140: Reading configuration data /etc/ssh_config eb96140: Connecting to sama.india.hp.com, port 22. eb96140: Socket created, turning on blocking... eb96140: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2-pw exp26 eb96140: Net::SSH::Perl Version 1.25, protocol version 2.0. eb96140: No compat match: OpenSSH_3.7.1p2-pwexp26. eb96140: Connection established. eb96140: Sent key-exchange init (KEXINIT), wait response. eb96140: Algorithms, c->s: 3des-cbc hmac-sha1 none eb96140: Algorithms, s->c: 3des-cbc hmac-sha1 none eb96140: Entering Diffie-Hellman Group 1 key exchange. eb96140: Sent DH public key, waiting for reply. eb96140: Received host key, type 'ssh-dss'. eb96140: Computing shared secret key. eb96140: Verifying server signature. eb96140: Waiting for NEWKEYS message. eb96140: Enabling incoming encryption/MAC/compression. eb96140: Send NEWKEYS, enable outgoing encryption/MAC/compression. eb96140: Sending request for user-authentication service. eb96140: Service accepted: ssh-userauth. eb96140: Trying empty user-authentication request. eb96140: Authentication methods that can continue: publickey,password,keyboard-i nteractive. eb96140: Next method to try is publickey. eb96140: Next method to try is password. eb96140: Trying password authentication. eb96140: Login completed, opening dummy shell channel. eb96140: channel 0: new [client-session] eb96140: Requesting channel_open for channel 0. eb96140: channel 0: open confirm rwindow 0 rmax 32768 eb96140: Got channel open confirmation, requesting shell. eb96140: Requesting service shell on channel 0. eb96140: channel 1: new [client-session] eb96140: Requesting channel_open for channel 1. eb96140: Entering interactive session. eb96140: Sending command: exit eb96140: Requesting service exec on channel 1. eb96140: channel 1: open confirm rwindow 0 rmax 32768 ============================================================================ ====== Thanks & Regards, Rishi -----Original Message----- From: ssh...@li... [mailto:ssh...@li...]On Behalf Of Mark A. Fuller Sent: Tuesday, March 23, 2004 9:28 PM To: Rishi Kaundinya M; 'Mark Fuller'; ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Rishi, regarding question #4, I think "exit" would be an appropriate way to terminate the secure shell. You're telling the remote host you're exiting and it will close the connection? Regarding your other questions: how different is Net::SSH::W32Perl? I just read about it on CPAN and it says it is a copy of Net::SSH::Perl from early 2002. Maybe it behaves differently? Have you tried to contact the author (Scott Scecina, as listed on the CPAN page)? You could try the same commands using Net::SSH::Perl and see if it fails too. Mark -----Original Message----- From: Rishi Kaundinya M <kau...@in...> Sent: Mar 23, 2004 7:26 AM To: 'Mark Fuller' <mar...@ea...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Mark, Thanks for the reply. Can you tell me why I am unable capture the output of "ls -al" in $out. Also after executing ssh->cmd, the code is stucking and the control is not going to the next statement following $ssh->cmd. Can you explain what I need to do for the script to contrinue executing all the instructions. Regards, Rishi -----Original Message----- From: Mark Fuller [mailto:mar...@ea...] Sent: Tuesday, March 23, 2004 7:38 PM To: Rishi Kaundinya M; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package I think what you are asking is how to trap errors and handle them without the script terminating? I had the same problem with Net::SFTP which uses the SSH module. My solution is described in a previous posting which can be found in the archive. http://sourceforge.net/mailarchive/forum.php?thread_id=3823363&forum_id=3651 4 You can process the @warnings array and take actions based on errors you recognize. Retry and write failures to a log, etc. Mark ----- Original Message ----- From: "Rishi Kaundinya M" <kau...@in...> To: <ssh...@li...> Sent: Tuesday, March 23, 2004 6:41 AM Subject: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package > > > -----Original Message----- > From: Rishi Kaundinya M [mailto:kau...@in...] > Sent: Tuesday, March 23, 2004 6:51 PM > To: 'ssh...@li...' > Subject: (Urgent) Information required on Net::SSH::W32Perl package > > Hi, > > I will appreciate your help in this regard. > > The requirement I have currently is as follows. > > Connect to a remote machine and based on the output of previous command > excute other commands. All the outputs will be stored in a local folder > in windows machine. I will be using perl2exe to generate final binary > out of my perl script. > > I have written a script as follows. > > ========================================================== > use Net::SSH::W32Perl; > > my $host = 'sama.india.hp.com'; > my $cmd="ls -al"; > my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => > 2); > $ssh->login(Rishi, XXXXX); > > #print "Hello \n", $str; > > $ssh->register_handler("stderr", sub { > my($channel, $buffer) = @_; > my $str = $buffer->bytes; > > print "\n How are you?"; > print "\n $str"; > exit; > > }); > > my ($out, $ err, $exit) = $ssh->cmd($cmd); > $ssh->cmd("exit"); > ============================================== > > I need following clarrification from you. > > 1. How can I detect the failure of login. I have seen following message > from the o/p of above code. > > "Permission denied at ex1.pl line 7". But I am going to lauch the > perl2exe > binary as daemon which don't have the terminal interaction. So please > let me know > how to detect the login failure. > > 2. I got stucked at the following point and unable to capture the output > of " ls -al" > in $out. I got following output while running the above code. > > eb96140: Next method to try is publickey. > eb96140: Next method to try is password. > eb96140: Trying password authentication. > eb96140: Login completed, opening dummy shell channel. > eb96140: channel 0: new [client-session] > eb96140: Requesting channel_open for channel 0. > eb96140: channel 0: open confirm rwindow 0 rmax 32768 > eb96140: Got channel open confirmation, requesting shell. > eb96140: Requesting service shell on channel 0. > eb96140: channel 1: new [client-session] > eb96140: Requesting channel_open for channel 1. > eb96140: Entering interactive session. > eb96140: Sending command: ls -al > eb96140: Requesting service exec on channel 1. > eb96140: channel 1: open confirm rwindow 0 rmax 32768 > > Where the program is stcued at the above point. Please let me know > how to get the output ls -al on sama in my windows script. > > Also code seems to not entring into the sub routine registered. > Please let me know what I need to do to solve the problem. > I am facing the same problem when I removed the "register_handler" > from my program. > > > 3. Is it possible to execute dependent commands (like cd followed ls -al) > from > my windows PC using ssh2 package. If so, can you please send me an > example code. > > 4. How to terminate the SSH session. Something like ssh->close is > available? > > Thanks in advance for your help, > > Regards, > Rishi > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Rishi K. M <kau...@in...> - 2004-03-23 16:50:55
|
Hi Mark, I have written small test program as follows. ========================================================================= use Net::SSH::W32Perl; my $host = 'sama.india.hp.com'; my $cmd="ls -al "; my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => 2); $ssh->login(Rishi, xxxxx); $ssh->cmd("exit"); print "\n Hi Rishi"; ============================================================================ ========== I got the following output. As you see the the program is not terminating and the I am not seeing "Hi Rishi" in the standard output. The program got stuck at the following point. <snip> channel 1: open confirm rwindow 0 rmax 32768 </snip> Can you please tell me what I need to do inorder the control to reach to print statement following $ssh->cmd("exit"). I am facing the same behaviour even though I did regoster_handler for the commands. I got stucked at this point in my project and need this information urgently. I appreciate your help in this regard. ============================================================================ =========== D:\Projects\console_logger\SSH\Test>perl ex1.pl eb96140: Reading configuration data /.ssh/config eb96140: Reading configuration data /etc/ssh_config eb96140: Connecting to sama.india.hp.com, port 22. eb96140: Socket created, turning on blocking... eb96140: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2-pw exp26 eb96140: Net::SSH::Perl Version 1.25, protocol version 2.0. eb96140: No compat match: OpenSSH_3.7.1p2-pwexp26. eb96140: Connection established. eb96140: Sent key-exchange init (KEXINIT), wait response. eb96140: Algorithms, c->s: 3des-cbc hmac-sha1 none eb96140: Algorithms, s->c: 3des-cbc hmac-sha1 none eb96140: Entering Diffie-Hellman Group 1 key exchange. eb96140: Sent DH public key, waiting for reply. eb96140: Received host key, type 'ssh-dss'. eb96140: Computing shared secret key. eb96140: Verifying server signature. eb96140: Waiting for NEWKEYS message. eb96140: Enabling incoming encryption/MAC/compression. eb96140: Send NEWKEYS, enable outgoing encryption/MAC/compression. eb96140: Sending request for user-authentication service. eb96140: Service accepted: ssh-userauth. eb96140: Trying empty user-authentication request. eb96140: Authentication methods that can continue: publickey,password,keyboard-i nteractive. eb96140: Next method to try is publickey. eb96140: Next method to try is password. eb96140: Trying password authentication. eb96140: Login completed, opening dummy shell channel. eb96140: channel 0: new [client-session] eb96140: Requesting channel_open for channel 0. eb96140: channel 0: open confirm rwindow 0 rmax 32768 eb96140: Got channel open confirmation, requesting shell. eb96140: Requesting service shell on channel 0. eb96140: channel 1: new [client-session] eb96140: Requesting channel_open for channel 1. eb96140: Entering interactive session. eb96140: Sending command: exit eb96140: Requesting service exec on channel 1. eb96140: channel 1: open confirm rwindow 0 rmax 32768 ============================================================================ ====== Thanks & Regards, Rishi -----Original Message----- From: ssh...@li... [mailto:ssh...@li...]On Behalf Of Mark A. Fuller Sent: Tuesday, March 23, 2004 9:28 PM To: Rishi Kaundinya M; 'Mark Fuller'; ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Rishi, regarding question #4, I think "exit" would be an appropriate way to terminate the secure shell. You're telling the remote host you're exiting and it will close the connection? Regarding your other questions: how different is Net::SSH::W32Perl? I just read about it on CPAN and it says it is a copy of Net::SSH::Perl from early 2002. Maybe it behaves differently? Have you tried to contact the author (Scott Scecina, as listed on the CPAN page)? You could try the same commands using Net::SSH::Perl and see if it fails too. Mark -----Original Message----- From: Rishi Kaundinya M <kau...@in...> Sent: Mar 23, 2004 7:26 AM To: 'Mark Fuller' <mar...@ea...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Mark, Thanks for the reply. Can you tell me why I am unable capture the output of "ls -al" in $out. Also after executing ssh->cmd, the code is stucking and the control is not going to the next statement following $ssh->cmd. Can you explain what I need to do for the script to contrinue executing all the instructions. Regards, Rishi -----Original Message----- From: Mark Fuller [mailto:mar...@ea...] Sent: Tuesday, March 23, 2004 7:38 PM To: Rishi Kaundinya M; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package I think what you are asking is how to trap errors and handle them without the script terminating? I had the same problem with Net::SFTP which uses the SSH module. My solution is described in a previous posting which can be found in the archive. http://sourceforge.net/mailarchive/forum.php?thread_id=3823363&forum_id=3651 4 You can process the @warnings array and take actions based on errors you recognize. Retry and write failures to a log, etc. Mark ----- Original Message ----- From: "Rishi Kaundinya M" <kau...@in...> To: <ssh...@li...> Sent: Tuesday, March 23, 2004 6:41 AM Subject: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package > > > -----Original Message----- > From: Rishi Kaundinya M [mailto:kau...@in...] > Sent: Tuesday, March 23, 2004 6:51 PM > To: 'ssh...@li...' > Subject: (Urgent) Information required on Net::SSH::W32Perl package > > Hi, > > I will appreciate your help in this regard. > > The requirement I have currently is as follows. > > Connect to a remote machine and based on the output of previous command > excute other commands. All the outputs will be stored in a local folder > in windows machine. I will be using perl2exe to generate final binary > out of my perl script. > > I have written a script as follows. > > ========================================================== > use Net::SSH::W32Perl; > > my $host = 'sama.india.hp.com'; > my $cmd="ls -al"; > my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => > 2); > $ssh->login(Rishi, XXXXX); > > #print "Hello \n", $str; > > $ssh->register_handler("stderr", sub { > my($channel, $buffer) = @_; > my $str = $buffer->bytes; > > print "\n How are you?"; > print "\n $str"; > exit; > > }); > > my ($out, $ err, $exit) = $ssh->cmd($cmd); > $ssh->cmd("exit"); > ============================================== > > I need following clarrification from you. > > 1. How can I detect the failure of login. I have seen following message > from the o/p of above code. > > "Permission denied at ex1.pl line 7". But I am going to lauch the > perl2exe > binary as daemon which don't have the terminal interaction. So please > let me know > how to detect the login failure. > > 2. I got stucked at the following point and unable to capture the output > of " ls -al" > in $out. I got following output while running the above code. > > eb96140: Next method to try is publickey. > eb96140: Next method to try is password. > eb96140: Trying password authentication. > eb96140: Login completed, opening dummy shell channel. > eb96140: channel 0: new [client-session] > eb96140: Requesting channel_open for channel 0. > eb96140: channel 0: open confirm rwindow 0 rmax 32768 > eb96140: Got channel open confirmation, requesting shell. > eb96140: Requesting service shell on channel 0. > eb96140: channel 1: new [client-session] > eb96140: Requesting channel_open for channel 1. > eb96140: Entering interactive session. > eb96140: Sending command: ls -al > eb96140: Requesting service exec on channel 1. > eb96140: channel 1: open confirm rwindow 0 rmax 32768 > > Where the program is stcued at the above point. Please let me know > how to get the output ls -al on sama in my windows script. > > Also code seems to not entring into the sub routine registered. > Please let me know what I need to do to solve the problem. > I am facing the same problem when I removed the "register_handler" > from my program. > > > 3. Is it possible to execute dependent commands (like cd followed ls -al) > from > my windows PC using ssh2 package. If so, can you please send me an > example code. > > 4. How to terminate the SSH session. Something like ssh->close is > available? > > Thanks in advance for your help, > > Regards, > Rishi > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Mark A. F. <mar...@ea...> - 2004-03-23 15:59:42
|
Rishi, regarding question #4, I think "exit" would be an appropriate way to terminate the secure shell. You're telling the remote host you're exiting and it will close the connection? Regarding your other questions: how different is Net::SSH::W32Perl? I just read about it on CPAN and it says it is a copy of Net::SSH::Perl from early 2002. Maybe it behaves differently? Have you tried to contact the author (Scott Scecina, as listed on the CPAN page)? You could try the same commands using Net::SSH::Perl and see if it fails too. Mark -----Original Message----- From: Rishi Kaundinya M <kau...@in...> Sent: Mar 23, 2004 7:26 AM To: 'Mark Fuller' <mar...@ea...>, ssh...@li... Subject: RE: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package Hi Mark, Thanks for the reply. Can you tell me why I am unable capture the output of "ls -al" in $out. Also after executing ssh->cmd, the code is stucking and the control is not going to the next statement following $ssh->cmd. Can you explain what I need to do for the script to contrinue executing all the instructions. Regards, Rishi -----Original Message----- From: Mark Fuller [mailto:mar...@ea...] Sent: Tuesday, March 23, 2004 7:38 PM To: Rishi Kaundinya M; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package I think what you are asking is how to trap errors and handle them without the script terminating? I had the same problem with Net::SFTP which uses the SSH module. My solution is described in a previous posting which can be found in the archive. http://sourceforge.net/mailarchive/forum.php?thread_id=3823363&forum_id=3651 4 You can process the @warnings array and take actions based on errors you recognize. Retry and write failures to a log, etc. Mark ----- Original Message ----- From: "Rishi Kaundinya M" <kau...@in...> To: <ssh...@li...> Sent: Tuesday, March 23, 2004 6:41 AM Subject: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package > > > -----Original Message----- > From: Rishi Kaundinya M [mailto:kau...@in...] > Sent: Tuesday, March 23, 2004 6:51 PM > To: 'ssh...@li...' > Subject: (Urgent) Information required on Net::SSH::W32Perl package > > Hi, > > I will appreciate your help in this regard. > > The requirement I have currently is as follows. > > Connect to a remote machine and based on the output of previous command > excute other commands. All the outputs will be stored in a local folder > in windows machine. I will be using perl2exe to generate final binary > out of my perl script. > > I have written a script as follows. > > ========================================================== > use Net::SSH::W32Perl; > > my $host = 'sama.india.hp.com'; > my $cmd="ls -al"; > my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => > 2); > $ssh->login(Rishi, XXXXX); > > #print "Hello \n", $str; > > $ssh->register_handler("stderr", sub { > my($channel, $buffer) = @_; > my $str = $buffer->bytes; > > print "\n How are you?"; > print "\n $str"; > exit; > > }); > > my ($out, $ err, $exit) = $ssh->cmd($cmd); > $ssh->cmd("exit"); > ============================================== > > I need following clarrification from you. > > 1. How can I detect the failure of login. I have seen following message > from the o/p of above code. > > "Permission denied at ex1.pl line 7". But I am going to lauch the > perl2exe > binary as daemon which don't have the terminal interaction. So please > let me know > how to detect the login failure. > > 2. I got stucked at the following point and unable to capture the output > of " ls -al" > in $out. I got following output while running the above code. > > eb96140: Next method to try is publickey. > eb96140: Next method to try is password. > eb96140: Trying password authentication. > eb96140: Login completed, opening dummy shell channel. > eb96140: channel 0: new [client-session] > eb96140: Requesting channel_open for channel 0. > eb96140: channel 0: open confirm rwindow 0 rmax 32768 > eb96140: Got channel open confirmation, requesting shell. > eb96140: Requesting service shell on channel 0. > eb96140: channel 1: new [client-session] > eb96140: Requesting channel_open for channel 1. > eb96140: Entering interactive session. > eb96140: Sending command: ls -al > eb96140: Requesting service exec on channel 1. > eb96140: channel 1: open confirm rwindow 0 rmax 32768 > > Where the program is stcued at the above point. Please let me know > how to get the output ls -al on sama in my windows script. > > Also code seems to not entring into the sub routine registered. > Please let me know what I need to do to solve the problem. > I am facing the same problem when I removed the "register_handler" > from my program. > > > 3. Is it possible to execute dependent commands (like cd followed ls -al) > from > my windows PC using ssh2 package. If so, can you please send me an > example code. > > 4. How to terminate the SSH session. Something like ssh->close is > available? > > Thanks in advance for your help, > > Regards, > Rishi > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Rishi K. M <kau...@in...> - 2004-03-23 14:26:22
|
Hi Mark, Thanks for the reply. Can you tell me why I am unable capture the output of "ls -al" in $out. Also after executing ssh->cmd, the code is stucking and the control is not going to the next statement following $ssh->cmd. Can you explain what I need to do for the script to contrinue executing all the instructions. Regards, Rishi -----Original Message----- From: Mark Fuller [mailto:mar...@ea...] Sent: Tuesday, March 23, 2004 7:38 PM To: Rishi Kaundinya M; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package I think what you are asking is how to trap errors and handle them without the script terminating? I had the same problem with Net::SFTP which uses the SSH module. My solution is described in a previous posting which can be found in the archive. http://sourceforge.net/mailarchive/forum.php?thread_id=3823363&forum_id=3651 4 You can process the @warnings array and take actions based on errors you recognize. Retry and write failures to a log, etc. Mark ----- Original Message ----- From: "Rishi Kaundinya M" <kau...@in...> To: <ssh...@li...> Sent: Tuesday, March 23, 2004 6:41 AM Subject: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package > > > -----Original Message----- > From: Rishi Kaundinya M [mailto:kau...@in...] > Sent: Tuesday, March 23, 2004 6:51 PM > To: 'ssh...@li...' > Subject: (Urgent) Information required on Net::SSH::W32Perl package > > Hi, > > I will appreciate your help in this regard. > > The requirement I have currently is as follows. > > Connect to a remote machine and based on the output of previous command > excute other commands. All the outputs will be stored in a local folder > in windows machine. I will be using perl2exe to generate final binary > out of my perl script. > > I have written a script as follows. > > ========================================================== > use Net::SSH::W32Perl; > > my $host = 'sama.india.hp.com'; > my $cmd="ls -al"; > my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => > 2); > $ssh->login(Rishi, XXXXX); > > #print "Hello \n", $str; > > $ssh->register_handler("stderr", sub { > my($channel, $buffer) = @_; > my $str = $buffer->bytes; > > print "\n How are you?"; > print "\n $str"; > exit; > > }); > > my ($out, $ err, $exit) = $ssh->cmd($cmd); > $ssh->cmd("exit"); > ============================================== > > I need following clarrification from you. > > 1. How can I detect the failure of login. I have seen following message > from the o/p of above code. > > "Permission denied at ex1.pl line 7". But I am going to lauch the > perl2exe > binary as daemon which don't have the terminal interaction. So please > let me know > how to detect the login failure. > > 2. I got stucked at the following point and unable to capture the output > of " ls -al" > in $out. I got following output while running the above code. > > eb96140: Next method to try is publickey. > eb96140: Next method to try is password. > eb96140: Trying password authentication. > eb96140: Login completed, opening dummy shell channel. > eb96140: channel 0: new [client-session] > eb96140: Requesting channel_open for channel 0. > eb96140: channel 0: open confirm rwindow 0 rmax 32768 > eb96140: Got channel open confirmation, requesting shell. > eb96140: Requesting service shell on channel 0. > eb96140: channel 1: new [client-session] > eb96140: Requesting channel_open for channel 1. > eb96140: Entering interactive session. > eb96140: Sending command: ls -al > eb96140: Requesting service exec on channel 1. > eb96140: channel 1: open confirm rwindow 0 rmax 32768 > > Where the program is stcued at the above point. Please let me know > how to get the output ls -al on sama in my windows script. > > Also code seems to not entring into the sub routine registered. > Please let me know what I need to do to solve the problem. > I am facing the same problem when I removed the "register_handler" > from my program. > > > 3. Is it possible to execute dependent commands (like cd followed ls -al) > from > my windows PC using ssh2 package. If so, can you please send me an > example code. > > 4. How to terminate the SSH session. Something like ssh->close is > available? > > Thanks in advance for your help, > > Regards, > Rishi > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Mark F. <mar...@ea...> - 2004-03-23 14:09:31
|
I think what you are asking is how to trap errors and handle them without the script terminating? I had the same problem with Net::SFTP which uses the SSH module. My solution is described in a previous posting which can be found in the archive. http://sourceforge.net/mailarchive/forum.php?thread_id=3823363&forum_id=36514 You can process the @warnings array and take actions based on errors you recognize. Retry and write failures to a log, etc. Mark ----- Original Message ----- From: "Rishi Kaundinya M" <kau...@in...> To: <ssh...@li...> Sent: Tuesday, March 23, 2004 6:41 AM Subject: [Ssh-sftp-perl-users] RE: (Urgent) Information required on Net::SSH::W32Perl package > > > -----Original Message----- > From: Rishi Kaundinya M [mailto:kau...@in...] > Sent: Tuesday, March 23, 2004 6:51 PM > To: 'ssh...@li...' > Subject: (Urgent) Information required on Net::SSH::W32Perl package > > Hi, > > I will appreciate your help in this regard. > > The requirement I have currently is as follows. > > Connect to a remote machine and based on the output of previous command > excute other commands. All the outputs will be stored in a local folder > in windows machine. I will be using perl2exe to generate final binary > out of my perl script. > > I have written a script as follows. > > ========================================================== > use Net::SSH::W32Perl; > > my $host = 'sama.india.hp.com'; > my $cmd="ls -al"; > my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => > 2); > $ssh->login(Rishi, XXXXX); > > #print "Hello \n", $str; > > $ssh->register_handler("stderr", sub { > my($channel, $buffer) = @_; > my $str = $buffer->bytes; > > print "\n How are you?"; > print "\n $str"; > exit; > > }); > > my ($out, $ err, $exit) = $ssh->cmd($cmd); > $ssh->cmd("exit"); > ============================================== > > I need following clarrification from you. > > 1. How can I detect the failure of login. I have seen following message > from the o/p of above code. > > "Permission denied at ex1.pl line 7". But I am going to lauch the > perl2exe > binary as daemon which don't have the terminal interaction. So please > let me know > how to detect the login failure. > > 2. I got stucked at the following point and unable to capture the output > of " ls -al" > in $out. I got following output while running the above code. > > eb96140: Next method to try is publickey. > eb96140: Next method to try is password. > eb96140: Trying password authentication. > eb96140: Login completed, opening dummy shell channel. > eb96140: channel 0: new [client-session] > eb96140: Requesting channel_open for channel 0. > eb96140: channel 0: open confirm rwindow 0 rmax 32768 > eb96140: Got channel open confirmation, requesting shell. > eb96140: Requesting service shell on channel 0. > eb96140: channel 1: new [client-session] > eb96140: Requesting channel_open for channel 1. > eb96140: Entering interactive session. > eb96140: Sending command: ls -al > eb96140: Requesting service exec on channel 1. > eb96140: channel 1: open confirm rwindow 0 rmax 32768 > > Where the program is stcued at the above point. Please let me know > how to get the output ls -al on sama in my windows script. > > Also code seems to not entring into the sub routine registered. > Please let me know what I need to do to solve the problem. > I am facing the same problem when I removed the "register_handler" > from my program. > > > 3. Is it possible to execute dependent commands (like cd followed ls -al) > from > my windows PC using ssh2 package. If so, can you please send me an > example code. > > 4. How to terminate the SSH session. Something like ssh->close is > available? > > Thanks in advance for your help, > > Regards, > Rishi > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Rishi K. M <kau...@in...> - 2004-03-23 13:48:20
|
Hi, I will appreciate your help in this regard. The requirement I have currently is as follows. Connect to a remote machine and based on the output of previous command excute other commands. All the outputs will be stored in a local folder in windows machine. I will be using perl2exe to generate final binary out of my perl script. I have written a script as follows. ========================================================== use Net::SSH::W32Perl; my $host = 'sama.india.hp.com'; my $cmd="ls -al"; my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => 2); $ssh->login(Rishi, XXXXX); #print "Hello \n", $str; $ssh->register_handler("stderr", sub { my($channel, $buffer) = @_; my $str = $buffer->bytes; print "\n How are you?"; print "\n $str"; exit; }); my ($out, $ err, $exit) = $ssh->cmd($cmd); $ssh->cmd("exit"); ============================================== I need following clarrification from you. 1. How can I detect the failure of login. I have seen following message from the o/p of above code. "Permission denied at ex1.pl line 7". But I am going to lauch the perl2exe binary as daemon which don't have the terminal interaction. So please let me know how to detect the login failure. 2. I got stucked at the following point and unable to capture the output of " ls -al" in $out. I got following output while running the above code. eb96140: Next method to try is publickey. eb96140: Next method to try is password. eb96140: Trying password authentication. eb96140: Login completed, opening dummy shell channel. eb96140: channel 0: new [client-session] eb96140: Requesting channel_open for channel 0. eb96140: channel 0: open confirm rwindow 0 rmax 32768 eb96140: Got channel open confirmation, requesting shell. eb96140: Requesting service shell on channel 0. eb96140: channel 1: new [client-session] eb96140: Requesting channel_open for channel 1. eb96140: Entering interactive session. eb96140: Sending command: ls -al eb96140: Requesting service exec on channel 1. eb96140: channel 1: open confirm rwindow 0 rmax 32768 Where the program is stcued at the above point. Please let me know how to get the output ls -al on sama in my windows script. Also code seems to not entring into the sub routine registered. Please let me know what I need to do to solve the problem. I am facing the same problem when I removed the "register_handler" from my program. 3. Is it possible to execute dependent commands (like cd followed ls -al) from my windows PC using ssh2 package. If so, can you please send me an example code. 4. How to terminate the SSH session. Something like ssh->close is available? Thanks in advance for your help, Regards, Rishi ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Rishi K. M <kau...@in...> - 2004-03-23 13:41:24
|
-----Original Message----- From: Rishi Kaundinya M [mailto:kau...@in...] Sent: Tuesday, March 23, 2004 6:51 PM To: 'ssh...@li...' Subject: (Urgent) Information required on Net::SSH::W32Perl package Hi, I will appreciate your help in this regard. The requirement I have currently is as follows. Connect to a remote machine and based on the output of previous command excute other commands. All the outputs will be stored in a local folder in windows machine. I will be using perl2exe to generate final binary out of my perl script. I have written a script as follows. ========================================================== use Net::SSH::W32Perl; my $host = 'sama.india.hp.com'; my $cmd="ls -al"; my $ssh = new Net::SSH::W32Perl($host, port => 22, debug => 1, protocol => 2); $ssh->login(Rishi, XXXXX); #print "Hello \n", $str; $ssh->register_handler("stderr", sub { my($channel, $buffer) = @_; my $str = $buffer->bytes; print "\n How are you?"; print "\n $str"; exit; }); my ($out, $ err, $exit) = $ssh->cmd($cmd); $ssh->cmd("exit"); ============================================== I need following clarrification from you. 1. How can I detect the failure of login. I have seen following message from the o/p of above code. "Permission denied at ex1.pl line 7". But I am going to lauch the perl2exe binary as daemon which don't have the terminal interaction. So please let me know how to detect the login failure. 2. I got stucked at the following point and unable to capture the output of " ls -al" in $out. I got following output while running the above code. eb96140: Next method to try is publickey. eb96140: Next method to try is password. eb96140: Trying password authentication. eb96140: Login completed, opening dummy shell channel. eb96140: channel 0: new [client-session] eb96140: Requesting channel_open for channel 0. eb96140: channel 0: open confirm rwindow 0 rmax 32768 eb96140: Got channel open confirmation, requesting shell. eb96140: Requesting service shell on channel 0. eb96140: channel 1: new [client-session] eb96140: Requesting channel_open for channel 1. eb96140: Entering interactive session. eb96140: Sending command: ls -al eb96140: Requesting service exec on channel 1. eb96140: channel 1: open confirm rwindow 0 rmax 32768 Where the program is stcued at the above point. Please let me know how to get the output ls -al on sama in my windows script. Also code seems to not entring into the sub routine registered. Please let me know what I need to do to solve the problem. I am facing the same problem when I removed the "register_handler" from my program. 3. Is it possible to execute dependent commands (like cd followed ls -al) from my windows PC using ssh2 package. If so, can you please send me an example code. 4. How to terminate the SSH session. Something like ssh->close is available? Thanks in advance for your help, Regards, Rishi |
From: Mark F. <mar...@ea...> - 2004-03-11 15:02:30
|
I use Perl's "fork" function. Put the following in a subroutine and call this subroutine from your "foreach" loop. If you need to avoid zombies, you'll have to use "$SIG{CHLD}= 'IGNORE'" (or refer to a subroutine which will "waitpid" to harvest the children.) ============================ my $childPid = fork; # fork a new copy of script if ($childPid) { return; # parent returns } if (!defined($childPid)) { print STDERR 'Fork failed.' . "\n"; exit 99; } # do your ssh command here exit; # child exits, do *not* return ============================= Mark ----- Original Message ----- From: "Jean-Paul Le Fèvre" <le...@he...> To: <ssh...@li...> Sent: Thursday, March 11, 2004 2:45 AM Subject: [Ssh-sftp-perl-users] How to execute ssh command in background ? > > > ssh(1) provides the option -f used to request > execution in background. I would like to have > this possibility with Net::SSH::Perl. > > I need a perl script to launch the same command > on several remote hosts, something like : > > foreach $host (@grid) > $ssh->cmd($my_command); > > However, doing so, the script stays blocked on > the first step and does not process the next > items in the list. > > I've tried to add '&' in various places but > unsuccessfully. > > P.S. > my_command is rmiregistry. > > > -- > ___________________________________________________________________ > > Jean-Paul Le Fèvre * Mail : Le...@fo... > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Jean-Paul Le F. <le...@he...> - 2004-03-11 10:03:57
|
ssh(1) provides the option -f used to request execution in background. I would like to have this possibility with Net::SSH::Perl. I need a perl script to launch the same command on several remote hosts, something like : foreach $host (@grid) $ssh->cmd($my_command); However, doing so, the script stays blocked on the first step and does not process the next items in the list. I've tried to add '&' in various places but unsuccessfully. P.S. my_command is rmiregistry. -- ___________________________________________________________________ Jean-Paul Le Fèvre * Mail : Le...@fo... |