ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 34)
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: Julien E. <pan...@as...> - 2004-12-02 09:40:49
|
Hi all, I'm pretty new with Net::SSH:Perl and I'm trying something perhaps too difficult for me. Here is it : I run keychain, an OpenSSH key manager. When running it first time, it asks for the passphrase of the key and give it to a ssh-agent. To use my key, I need to run : $ SSH_AUTH_SOCK=/tmp/ssh-lPqB5586/agent.5586; export SSH_AUTH_SOCK; $ SSH_AGENT_PID=5588; export SSH_AGENT_PID; For example. With this, I need to connect to a remote ssh server with public key authentication without typing a password. I really need this because I can't type a passphrase or pass AND I don't want to stock the password in the perl script (I work in root). Here's the base script I'm trying to make work : #!/usr/bin/perl use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("192.168.1.9"); my $auth = Net::SSH::Perl::Auth->new('PublicKey', $ssh); $auth->authenticate; $ssh->login("root"); $ssh->cmd("/bin/touch /ok.txt"); Of course, it doesn't work : Can't call method "agent" on an undefined value at /usr/local/share/perl/5.8.2/Net/SSH/Perl/Auth/PublicKey.pm line 42, <GEN0> line 1. I cannot find any example to use an ssh-agent in the doc or on internet (I searched the list archives too). Can someone give me a few tips on how to do this ? Thanks Julien Escario |
From: Steve S. <sap...@gs...> - 2004-11-25 12:44:42
|
Mihai Secasiu wrote: > On Wednesday 24 November 2004 00:27, thefinn wrote: > >>I now get the "permission denied" and a complete exit of the program when >>the user/pass pairs are wrong. I'd like to change this to just have it give >>me some kind of error code. > > I needed the same thing and I modified some files to eliminate the call that > makes the script die ( fatal_disconnect ) . I placed the error in a session > string and it can be retrieved using a new method $ssh->get_error(); > If you want I will post this patch here. I talked to the maintainer of the > code and he is willing to let me incorporate this patch into the next > release. You can just put the call in an eval block and check the error code, something like this: eval { $ssh->login($user, $pass) }; if ($@) { warn "Loging failed: $@\n"; } -- Steve Sapovits |
From: Mihai S. <mih...@de...> - 2004-11-24 15:21:15
|
On Wednesday 24 November 2004 00:27, thefinn wrote: > I now get the "permission denied" and a complete exit of the program when > the user/pass pairs are wrong. I'd like to change this to just have it give > me some kind of error code. I needed the same thing and I modified some files to eliminate the call that makes the script die ( fatal_disconnect ) . I placed the error in a session string and it can be retrieved using a new method $ssh->get_error(); If you want I will post this patch here. I talked to the maintainer of the code and he is willing to let me incorporate this patch into the next release. -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: Mihai S. <mih...@de...> - 2004-11-24 15:20:49
|
On Wednesday 24 November 2004 00:27, thefinn wrote: > I now get the "permission denied" and a complete exit of the program when > the user/pass pairs are wrong. I'd like to change this to just have it give > me some kind of error code. I needed the same thing and I modified some files to eliminate the call that makes the script die ( fatal_disconnect ) . I placed the error in a session string and it can be retrieved using a new method $ssh->get_error(); If you want I will post this patch here. I talked to the maintainer of the code and he is willing to let me incorporate this patch into the next release. -- +----------------------------------------------------------------------- | Mihai Secasiu | http://denixsolutions.com/ | Complete Unix/Linux Solutions for your Business +----------------------------------------------------------------------- |
From: Mark F. <mar...@ea...> - 2004-11-24 02:15:53
|
Seth, Below is the example of using Expect.pm to interact with an sftp executable. I hope it's not too much of a mess after all the email line-wrapping. I carved this out of a larger script where many of these functions are in reuseable subroutines (so I could use the same code for sftp, or ftp, or anything else). You'll probably hit a few errors since this isn't the exact code I execute. But, generally, the below is what I do. Notwithstanding the syntax errors you may receive, it should be all you need to do to use Expect.pm. If you can improve this example and post something better, please do. (Also, this isn't meant to imply the ssh-sftp Perl module isn't useful. The expect-driven binary is just another way that might be helpful.) Mark ========================================= #! /usr/bin/perl -w use strict; use Expect; #*************************************************************************** **** # This is an example of using Expect.pm (search CPAN for it. Current version is # 1.15 on Nov. 23 2004. Or, go to http://sourceforge.net/projects/expectperl/ . # The "Io_Tty" module is also shown at that site. I don't recall if the # installation requires that module.) # # The following should recreate this command line execution of sftp: # # sftp -oidentityFile=/home/server_user/.ssh/id_dsa.nopass -oUser=client_user some_host <<EOF # put source_file target_file # EOF # # Just change the hardcoded @expectParms to match your requirements (user, host # identity filename). # # WARNING. I carved the following out of a larger script with more abstract # uses of what follows. I haven't *actually* executed the following. You may # run into typos and other problems that cause the Perl interpreter to fail. # It's only meant to help you start in the right direction without the need to # read the Expect.pm documentation and experiment with it. The following should # work after you do my debugging for me. :) #*************************************************************************** **** #--------------------------------------------------------------------------- ---- # Create the object and set the logging to go to a subroutine where log messages # can be accumulated and later interrogated between subcommands (to navigate and # selectively execute subcommands). #--------------------------------------------------------------------------- ---- my $expect = new Expect; our $expect_log; # used by the subroutine coderef'ed on the next line. $expect->log_file(\&logExpect); #--------------------------------------- # Uncomment the following for debugging # information. #--------------------------------------- #$expect->exp_internal(1); #$expect->debug(2); #--------------------------------------------------------------------------- ---- # Hardcoded command-line parms to sftp. You'll want to change this to whatever # command line you use. #--------------------------------------------------------------------------- ---- my @expectParms; $expectParms[0] = '-oidentityFile=/home/server_user/.ssh/id_dsa.nopass'; $expectParms[1] = '-oUser='client_user'; $expectParms[2] = 'some_hostname'; #--------------------------------------------------------------------------- ---- # Start the command. This is where it starts. The parms are passed as an array. #--------------------------------------------------------------------------- ---- if (!$expect->spawn('sftp', @expectParms )) { print 'Command failed to exectute.' . "\n"; exit 99; } # end failed spawn #--------------------------------------------------------------------------- ---- # Setup the expected results. They can be literal strings (prefixed with -ex), # or regular expressions (prefixed with -re). You have to follow the pattern # below, even if they are all literals or regexes. The prefix is one array # element, the value the next array element. Over and over and over, prefix and # value in alternating array elements. # # The ->expect method call will tell you which element matched. #--------------------------------------------------------------------------- ---- my @expectedResults; $expectedResults[0] = '-ex'; $expectedResults[1] = 'sftp>'; $expectedResults[2] = '-re'; $expectedResults[3] = '^sftp\>\n'; # sftp prompt and newline (as an example. You # may not get a newline after the sftp # prompt.) #--------------------------------------------------------------------------- ---- # Now do the expect, for the specified timeout, looking for the values in the # prefix/value alternating array created above. # # Note that @expect_results is a differnt array. It contains # # [0] The item in @expectResults which matched. # [1] The error code (undef, 1:TIMEOUT, 2: EOF which means connection closed I # think, 3:spawn id($fileno) died, 4:$! indicating whatever error was set in # $ERRNO during the last read on $object's handle) # [2] The string that successully matched. # [3] The string preceeding the match string. # [4] The string following the match string. # # You'll be most interested in whether the error is undef, and which element of # @expectedResults was matched (to make decisions about what to do next). # # Next you'll be interested in the $expect_log variable which was accumulated # with all the result messages. If this was a directory listing, you'd want to # expect for the sftp> prompt to know it received the entire directory listing. # You might also be interested in any strings indicating the directory wasn't # found (indicating an error). Then you'd be interested in the error_log # variable to interrogate the actual directory listing data (to look for a # specific file, perhaps). #--------------------------------------------------------------------------- ---- my @expect_results; @expect_results = $expect->expect(30, @expectedResults); if ($expect_results[1]) { if ($expect_results[1] ne '1:TIMEOUT') { print 'Got a non-timeout error." . "\n"; exit 99; } else { print 'Timed out.' . "\n"; exit 99; } print 'Matched on expected value #: ' . $expect_results[1] . "\n"; #--------------------------------------------------------------------------- ---- # Clear the accumulater. This is the storage each ->expect method call will # search. Clear it before doing another ->expect (unless you have a good reason # not to). #--------------------------------------------------------------------------- ---- $expect->clear_accum(); #--------------------------------------------------------------------------- ---- # Send a subcommand. This doesn't seem to return a success of failure. You just # send the subcommand and let the ->expect method call do the work for you. #--------------------------------------------------------------------------- ---- $expect->send('put source_file target_file' . "\n"); #--------------------------------------------------------------------------- ---- # Perform the ->expect method like above. I won't recreate it here. But, you # want to setup the the array of expected literal(s) and/or regex(es). Call # the ->expect method, and determine how the method returned to you (error, # timeout, which element it matched on). Perhaps process the $expect_log # variable if you want to have greater control over the results of the # subcommand. #--------------------------------------------------------------------------- ---- # The POD has a lot more options. The above seems to work well for sftp. You can # do the ->send and ->expect methods repeatedly until you ->send('quit') and # probably don't care about the result. exit; #*************************************************************************** **** # logExpect # # Used by the expect->log_file method as a callback to capture result messages. #*************************************************************************** **** sub logExpect { foreach (@_) { $expect_log .= $_; } return; } |
From: Mark F. <mar...@ea...> - 2004-11-24 00:15:48
|
> I now get the "permission denied" and a complete exit of the program when the > user/pass pairs are wrong. I'd like to change this to just have it give me > some kind of error code. I think you need to surround your method call within an eval block and catch the die. I posted something to this list last February about how I worked around this. It involves eval and capturing SIG{__WARN__}. It seemed like multiple warnings could occur before a die. So, catching that signal let me accumulate them before the die. The example I posted uses "do_realpath." I don't think it actually dies. But, some other things like connecting and logging in do. I got in the habit of wrapping everything this way. See: http://sourceforge.net/mailarchive/message.php?msg_id=7114680 Seth, I'll post the Expect.pm example later. Mark |
From: thefinn <th...@tp...> - 2004-11-23 22:28:06
|
Yeah really odd, I seem to have got it to work on x86 no problems. I think it must have something to do with my version of gmp. It is aurora linux 1.92. Very odd. I now get the "permission denied" and a complete exit of the program when the user/pass pairs are wrong. I'd like to change this to just have it give me some kind of error code. TF On Wednesday 24 November 2004 08:47, Seth Rothenberg wrote: > Mark, > > >>> "Mark Fuller" <mar...@ea...> 11/20/2004 12:01:23 PM > >>> > >>>If you decide to use Expect.pm let me know and I can carve out an > > example > > >>>from what I'm doing. It's really easy. > > Actually, if it's not much trouble, I would appreciate it. > > I got perl-sftp to compile and run on some of my systems (Sparcs > running Solaris 2.6 and 8). > (It runs on one, after updating gcc, perl, and many cpan updates, etc. > Doing the same > on other systems did not yield good compiles....) > > The above effort was tabled due to a deadline, so > I threw together a script to do the following: > list files in local dir > sftp + list files in remote > build a command file to transfer the missing files > check that all the transferred files made it > delete those that succeeded > > All this using the system function and sftp that comes with openssh, > I have not looked at expect at all. > > The above gets run repeatedly in a cron tab. > > (and I have code to do the opposite, pull down from sftp server). > > > > > > ------------------------------------------------------- > 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 -- http://ghettoshell.net |
From: Seth R. <SRO...@mo...> - 2004-11-23 21:51:51
|
Mark, >>> "Mark Fuller" <mar...@ea...> 11/20/2004 12:01:23 PM >>> >>>If you decide to use Expect.pm let me know and I can carve out an example >>>from what I'm doing. It's really easy. Actually, if it's not much trouble, I would appreciate it. I got perl-sftp to compile and run on some of my systems (Sparcs running Solaris 2.6 and 8). (It runs on one, after updating gcc, perl, and many cpan updates, etc. Doing the same on other systems did not yield good compiles....) The above effort was tabled due to a deadline, so I threw together a script to do the following: list files in local dir sftp + list files in remote build a command file to transfer the missing files check that all the transferred files made it delete those that succeeded All this using the system function and sftp that comes with openssh, I have not looked at expect at all. The above gets run repeatedly in a cron tab. (and I have code to do the opposite, pull down from sftp server). |
From: thefinn <th...@tp...> - 2004-11-22 02:40:37
|
Naaa, I REALLY need this module - or something similar working. What I've found is that it was the sparc32 architecture running Fedora 3. And I THINK but cannot be sure, that it's having problems running a the big-endian math routines. If I could do what I'm doing with something slower, I would. Unfortunately I can't :\ I got this working on 32bit x86, however now the error codes are stuffing me up. Once you pass the routine the login/password pair and start the connection you can't check if it's active or not. $ssh->sock; returns nothing. Not my week it really isn't. TF -- http://ghettoshell.net |
From: Mark F. <mar...@ea...> - 2004-11-20 17:01:24
|
If you decide to use Expect.pm let me know and I can carve out an example from what I'm doing. It's really easy. I agree that the Expect.pm documentation requires a lot of reading and experimentation. But, once you get through many options which you have no use for, it's quite simple. To me, the strength is that it's WYSIWYG. What I mean is: if you're getting results that you don't understand you can execute the binary manually. Having that as a reference point is a benefit. Mark ----- Original Message ----- From: "Steffen Schumacher" <st...@sc...> > > Expect is my alternative, if (when) I'm convinced that the Net::SSH::Perl > package won't work.. Problem is that I have no knowledge of Expect, so I'm > a little hesitant.. |
From: Steffen S. <st...@sc...> - 2004-11-20 16:44:18
|
On 20.11.2004 09:17:40 +0000, Mark Fuller wrote: > I probably can't help much. But, have you guys tried using Expect.pm from > CPAN to drive an ssh or sftp executable (for example, the binaries from > openSSH)? I found this to be easier (in my case) than working with the > ssh-sftp Perl module. Another benefit was that, if anything didn't work > right as I drove the binary with Expect.pm, I could manually execute the > binary to test it. I really underestimated how useful it is to be able to > execute it natively as a reference. > > I've been doing this on Linux. That's all I can speak for. I don't know > whether Expect.PM would work on Windows platforms. > Expect is my alternative, if (when) I'm convinced that the Net::SSH::Perl package won't work.. Problem is that I have no knowledge of Expect, so I'm a little hesitant.. /Steffen > Just a possible alternative. > > Mark > > ----- Original Message ----- > From: "Steffen Schumacher" <st...@sc...> > To: "thefinn" <th...@tp...> > Cc: <ssh...@li...> > Sent: Saturday, November 20, 2004 3:08 AM > Subject: Re: [Ssh-sftp-perl-users] errors :( > > > > On 20.11.2004 19:49:14 +0000, thefinn wrote: > > > I had some problems with writing my own so I went to the example code > and got > > > the same issue. Here's the output of pssh: > > > > > > [root@ghettoshell eg]# ./pssh 203.26.137.3 ls > > > Illegal instruction > > > > > > > Sorry dude! > > I posted a question here about a week ago - your're the > > first thing I've recieved from this list.. Don't > > think posting here produces a lot of help.. sorry.. > > > > /Steffen > > > > > > > TF > > > -- > > > http://ghettoshell.net > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: InterSystems CACHE > > > FREE OODBMS DOWNLOAD - A multidimensional database that combines > > > robust object and relational technologies, making it a perfect match > > > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > > > _______________________________________________ > > > 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: InterSystems CACHE > > FREE OODBMS DOWNLOAD - A multidimensional database that combines > > robust object and relational technologies, making it a perfect match > > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > > _______________________________________________ > > Ssh-sftp-perl-users mailing list > > Ssh...@li... > > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > |
From: Mark F. <mar...@ea...> - 2004-11-20 16:17:43
|
I probably can't help much. But, have you guys tried using Expect.pm from CPAN to drive an ssh or sftp executable (for example, the binaries from openSSH)? I found this to be easier (in my case) than working with the ssh-sftp Perl module. Another benefit was that, if anything didn't work right as I drove the binary with Expect.pm, I could manually execute the binary to test it. I really underestimated how useful it is to be able to execute it natively as a reference. I've been doing this on Linux. That's all I can speak for. I don't know whether Expect.PM would work on Windows platforms. Just a possible alternative. Mark ----- Original Message ----- From: "Steffen Schumacher" <st...@sc...> To: "thefinn" <th...@tp...> Cc: <ssh...@li...> Sent: Saturday, November 20, 2004 3:08 AM Subject: Re: [Ssh-sftp-perl-users] errors :( > On 20.11.2004 19:49:14 +0000, thefinn wrote: > > I had some problems with writing my own so I went to the example code and got > > the same issue. Here's the output of pssh: > > > > [root@ghettoshell eg]# ./pssh 203.26.137.3 ls > > Illegal instruction > > > > Sorry dude! > I posted a question here about a week ago - your're the > first thing I've recieved from this list.. Don't > think posting here produces a lot of help.. sorry.. > > /Steffen > > > > TF > > -- > > http://ghettoshell.net > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: InterSystems CACHE > > FREE OODBMS DOWNLOAD - A multidimensional database that combines > > robust object and relational technologies, making it a perfect match > > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > > _______________________________________________ > > 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: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: thefinn <th...@tp...> - 2004-11-20 10:44:34
|
Poo. :( Don't suppose you had the same problem? TF On Saturday 20 November 2004 21:08, Steffen Schumacher wrote: > On 20.11.2004 19:49:14 +0000, thefinn wrote: > > I had some problems with writing my own so I went to the example code and > > got the same issue. Here's the output of pssh: > > > > [root@ghettoshell eg]# ./pssh 203.26.137.3 ls > > Illegal instruction > > Sorry dude! > I posted a question here about a week ago - your're the > first thing I've recieved from this list.. Don't > think posting here produces a lot of help.. sorry.. > > /Steffen > > > TF > > -- > > http://ghettoshell.net > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: InterSystems CACHE > > FREE OODBMS DOWNLOAD - A multidimensional database that combines > > robust object and relational technologies, making it a perfect match > > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > > _______________________________________________ > > 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: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users -- http://ghettoshell.net |
From: Steffen S. <st...@sc...> - 2004-11-20 10:08:55
|
On 20.11.2004 19:49:14 +0000, thefinn wrote: > I had some problems with writing my own so I went to the example code and got > the same issue. Here's the output of pssh: > > [root@ghettoshell eg]# ./pssh 203.26.137.3 ls > Illegal instruction > Sorry dude! I posted a question here about a week ago - your're the first thing I've recieved from this list.. Don't think posting here produces a lot of help.. sorry.. /Steffen > TF > -- > http://ghettoshell.net > > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: thefinn <th...@tp...> - 2004-11-20 08:49:22
|
I had some problems with writing my own so I went to the example code and got the same issue. Here's the output of pssh: [root@ghettoshell eg]# ./pssh 203.26.137.3 ls Illegal instruction TF -- http://ghettoshell.net |
From: Steffen S. <st...@sc...> - 2004-11-17 16:07:30
|
Hi! I haven't really seen any mails on this list, so it might be dead, but here goes anyways: I work for an ISP, with both Juniper and Cisco routers.. We've already migrated to ssh vs. telnet on the Junipers, and are currently looking into dooing the same with Cisco.. Only problem is that I'm seeing some very strange behaviour in some cases.. We've built a script, which does an MPLS traceroute in our net, by logging into each box on the path to a destination, and sometimes we have a juniper M10(i) before a Cisco, which crashes ssh when using perl.. When the trace doesn't encounter any junipers, it all works neatly.. I've added some debug printouts, but I still don't get it: login1.nms.tele.dk: Reading configuration data /home/ssch/.ssh/config login1.nms.tele.dk: Reading configuration data /etc/ssh_config login1.nms.tele.dk: Connecting to 80.63.81.17, port 22. login1.nms.tele.dk: Remote protocol version 1.5, remote software version Cisco-1.25 login1.nms.tele.dk: Net::SSH::Perl Version 1.23-JUNOS, protocol version 1.5. login1.nms.tele.dk: No compat match: Cisco-1.25. login1.nms.tele.dk: Connection established. login1.nms.tele.dk: Waiting for server public key. login1.nms.tele.dk: Received server public key (768 bits) and host key (1024 bits). login1.nms.tele.dk: Host '80.63.81.17' is known and matches the host key. login1.nms.tele.dk: Encryption type: DES3 login1.nms.tele.dk: Sent encrypted session key. Encrypting the text: '$in' which is length($in) = 8 bytes long [69][104][206][111][168][126][233][50] login1.nms.tele.dk: Received encryption confirmation. Encrypting the text: '$in' which is length($in) = 8 bytes long [110][53][35][3][4][0][0][0] Encrypting the text: '$in' which is length($in) = 8 bytes long [131][210][185][70][6][44][134][232] Encrypting the text: '$in' which is length($in) = 8 bytes long [18][240][79][3][76][95][40][16] Encrypting the text: '$in' which is length($in) = 8 bytes long [62][105][126][18][67][15][242][109] Encrypting the text: '$in' which is length($in) = 8 bytes long [90][141][66][105][177][29][203][139] login1.nms.tele.dk: Trying password authentication. Encrypting the text: '$in' which is length($in) = 8 bytes long [252][153][78][247][207][41][255][240] Encrypting the text: '$in' which is length($in) = 8 bytes long [41][55][83][78][98][88][168][179] Encrypting the text: '$in' which is length($in) = 8 bytes long [79][82][217][40][0][135][189][139] Encrypting the text: '$in' which is length($in) = 8 bytes long [159][78][80][188][122][50][147][236] Encrypting the text: '$in' which is length($in) = 8 bytes long [249][202][18][240][27][164][228][27] Encrypting the text: '$in' which is length($in) = 8 bytes long [218][120][251][241][77][68][121][110] Encrypting the text: '$in' which is length($in) = 8 bytes long [255][34][146][226][53][113][57][11] login1.nms.tele.dk: Sending command with SSH1: show tag-switching forwarding-table tags 563 detail login1.nms.tele.dk: Started packet login1.nms.tele.dk: Filled in cmd.. Encrypting the text: '$in' which is length($in) = 8 bytes long [86][148][221][195][250][99][64][157] 80.63.81.17: input must be 8 bytes long at /usr/local/lib/perl5/site_perl/5.8.5/mach/Crypt/DES.pm line 57. I realize that the version of Net::SSH::Perl is a special modded version by Juniper, but it also does this with the regular one.. And also, it works when juniper routers is avoided.. Now, apart from enabling debug, i've added these printouts to CBC.pm (v.1,5): sub encrypt { my $cbc = shift; my $data = shift; my $retval = ""; my $iv = $cbc->{iv}; my $size = $cbc->{cipher}->blocksize; while (length $data) { my $in = substr($data, 0, $size, '') ^ $iv; > print "Encrypting the text: '\$in' which is length(\$in) = ".length($in)." bytes long\n"; > for(my $o=0; $o<length($in);$o++) { print "[".(ord(substr($in,$o,$o+1)))."]"; } > print "\n"; $iv = $cbc->{cipher}->encrypt($in); $retval .= $iv; } $cbc->{iv} = $iv; $retval; } Which is shown above.. Now! It complains that it didn't get input which we're 8 bytes long? Look at the debug trace and the printouts.. EVERYTHING is 8 bytes long!! what is the problem here?? Any help is much appreciated!! /Steffen |
From: Good T. <aa...@rd...> - 2004-10-28 20:54:29
|
i think you should send the commands you are executing to install the module and a little more about your system/environment (cygwin?) how many perl's do you have installed on the system? what is the output of perl -V you know, stuff like that. -- Through correctness comes ease -Chiun On Thu, October 28, 2004 2:22 pm, Roderick A. Anderson said: > I've tried on different systems but keep getting this error for the > Net::SSH:Win32Perl module. > > Error: no suitable installation target found for package Net-SSH-W32Perl. > > I have these defined. > > Repositories: > [1] ActiveState PPM2 Repository > [2] ActiveState Package Repository > [3] RothConsulting > [4] Theory > > Can I do a local machine install without a compiler etc? (And please > point me at the instructions as it has been months since the last time I > did this and since memory is one of the first three things to go with > age -- and I can't remember the other two. :-) > > > TIA, > Rod > -- > > --- > [This E-mail scanned for viruses by Declude Virus] > > > > ------------------------------------------------------- > This Newsletter Sponsored by: Macrovision > For reliable Linux application installations, use the industry's leading > setup authoring tool, InstallShield X. Learn more and evaluate > today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/ > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > |
From: Roderick A. A. <raa...@ts...> - 2004-10-28 19:22:58
|
I've tried on different systems but keep getting this error for the Net::SSH:Win32Perl module. Error: no suitable installation target found for package Net-SSH-W32Perl. I have these defined. Repositories: [1] ActiveState PPM2 Repository [2] ActiveState Package Repository [3] RothConsulting [4] Theory Can I do a local machine install without a compiler etc? (And please point me at the instructions as it has been months since the last time I did this and since memory is one of the first three things to go with age -- and I can't remember the other two. :-) TIA, Rod -- --- [This E-mail scanned for viruses by Declude Virus] |
From: Chaun K. <scu...@ho...> - 2004-10-27 19:03:36
|
Hello, I'm new to the list and am having a small problem with Net::SSH::Perl. I have a chunk of code that needs to be run on a remote machine via SSH2 and general commands that I am using seem to run fine. The problem I am having originates from an interactive form that pops up when I execute the p4 submit command. When I am logged into the server I can issue the command just like it is described in my code snippet, however, I need to complete it by pressing CTRL-D. I though that I could do the same thing in my Perl script with the /cD syntax, but from the output of the Net::SSH::Perl session below, it just hangs, seemingly waiting for "channel 4: rcvd eof" Thanks for any help you could offer, I don't see much on Google for this Module. ~Chaun Here is my code snippet: [snip] ($sshout, $ssherr, $sshexit) = $ssh->cmd("p4 add /path/to/file/Sample.jpg"); $sshout_p4add = $sshout; $ssherr_p4add = $ssherr; $sshexit_p4add = $sshexit; ($sshout, $ssherr, $sshexit) = $ssh->cmd("p4 submit -i\nChange: new\nClient: all_username\nUser: username\nStatus: new\nDescription: tTrack Issue: 3390\nFiles: //path/to/file/Sample.jpg # add\n\cD"); $sshout_p4sub = $sshout; $ssherr_p4sub = $ssherr; $sshexit_p4sub = $sshexit; [end snip] Here is the output from the Net:SSH::Perl session <server_name.com>: channel 3: new [client-session] <server_name.com>: Requesting channel_open for channel 3. <server_name.com>: Entering interactive session. <server_name.com>: Sending command: p4 add /path/to/file/Sample.jpg <server_name.com>: Requesting service exec on channel 3. <server_name.com>: channel 3: open confirm rwindow 0 rmax 32768 <server_name.com>: channel 3: rcvd eof <server_name.com>: channel 3: output open -> drain <server_name.com>: input_channel_request: rtype exit-status reply 0 <server_name.com>: channel 3: rcvd close <server_name.com>: channel 3: input open -> closed <server_name.com>: channel 3: close_read <server_name.com>: channel 3: obuf empty <server_name.com>: channel 3: output drain -> closed <server_name.com>: channel 3: close_write <server_name.com>: channel 3: send close <server_name.com>: channel 3: full closed <server_name.com>: channel 4: new [client-session] <server_name.com>: Requesting channel_open for channel 4. <server_name.com>: Entering interactive session. <server_name.com>: Sending command: p4 submit -i Change: new Client: all_username User: username Status: new Description: tTrack Issue: 3390 Files: //path/to/file/Sample.jpg # add <server_name.com>: Requesting service exec on channel 4. <server_name.com>: channel 4: open confirm rwindow 0 rmax 32768 _________________________________________________________________ Check out Election 2004 for up-to-date election news, plus voter tools and more! http://special.msn.com/msn/election2004.armx |
From: Steve S. <sap...@gs...> - 2004-10-25 13:14:20
|
> I have ssh and Net::SFTP working in an SSH2 environment (mostly > Solaris as a platform). It all works fine except for the methods > that return handles. These all return undef with no error or > warning messages. I added some debug to the source and can see > that each one gets an ID but that the get_handle() call on that > ID returns undef. Specifically, I've been trying to get the > do_open() and do_opendir() methods to work. It turns out I am getting handles. I was just trying to print them and they're unprintable. In bytes, I get these 3 handles for 2 directory opens and a file open: 00 00 00 00 00 00 00 01 00 00 00 02 Maybe this will help someone else who's expecting them to actually be _printable_ strings as I was. -- Steve Sapovits GSI Commerce, Inc. http://www.gsicommerce.com Email: sap...@gs... Work: 610-491-7087 Mobile: 610-574-7706 |
From: Jutu S. S. (Cognizant) <JSr...@ch...> - 2004-10-25 05:25:21
|
Hi, How to close the SFTP file handle? sftp->close(); #It is not working. Is thery any other way to handle= this? regards Srinivas -----Original Message----- From: ssh...@li... [mailto:ssh...@li...]On Behalf Of ssh...@li... Sent: Sunday, October 24, 2004 9:05 AM To: ssh...@li... Subject: Ssh-sftp-perl-users digest, Vol 1 #44 - 2 msgs Send Ssh-sftp-perl-users mailing list submissions to ssh...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users or, via email, send a message with subject or body 'help' to ssh...@li... You can reach the person managing the list at ssh...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Ssh-sftp-perl-users digest..." Today's Topics: 1. Net::SFTP methods that return handles (Steve Sapovits) 2. Help required with "auto exit" using SSH (Srinivasan Ramaswami) --__--__-- Message: 1 Date: Sat, 23 Oct 2004 12:13:12 -0400 From: Steve Sapovits <sap...@gs...> Reply-To: sap...@gs... Organization: GSI Commerce Inc. To: ssh...@li... Subject: [Ssh-sftp-perl-users] Net::SFTP methods that return handles I have ssh and Net::SFTP working in an SSH2 environment (mostly Solaris as a platform). It all works fine except for the methods that return handles. These all return undef with no error or warning messages. I added some debug to the source and can see that each one gets an ID but that the get_handle() call on that ID returns undef. Specifically, I've been trying to get the do_open() and do_opendir() methods to work. Any ideas? Thanks in advance ... --=0D Steve Sapovits GSI Commerce, Inc. http://www.gsicommerce.com Email: sap...@gs... --__--__-- Message: 2 Date: Sat, 23 Oct 2004 20:07:01 -0700 (PDT) From: Srinivasan Ramaswami <sri...@ya...> To: ssh...@li... Subject: [Ssh-sftp-perl-users] Help required with "auto exit" using SSH --0-1699601947-1098587221=3D:57638 Content-Type: text/plain; charset=3Dus-ascii On Solaris 2.8 I am using the following code to make a Secure FTP= connection with key encryption. When the perl program is done, I find a= core file on the target FTP server this program did a FTP Connection to.= When I did a "file core" command on the core file, it indicates the perl= program did an auto exit which caused this core dump. Since SFTP interface= does not have a $FTP_HANDLE->close call like in the FTP module. Has anyone= experienced this problem, how can I provide a normal exit. =0D Thank you for help in advance, Srinivasan =0D =0D Here is the code I use to connect to a remote server, put a test file and= close the program: =0D my $TestFile =3D "abc.txt"; $TargetPathAndFile =3D "/home/aUser"; my %keyValuePair =3D ("user", "aUSER", password","APassword","debug","1"); my $sftp =3D Net::SFTP->new("$myServer", keyValuePair); if (! $sftp) { my $ErrorMsg =3D "Failed connecting to $host: $!"; print ($ErrorMsg); exit (-1); } Trace ("Connected to "$myServer using Secure FTP Protocol..."); $sftp->put($TestFile, $TargetPathAndFile); exit(0); =0D --------------------------------- Do you Yahoo!? vote.yahoo.com - Register online to vote today! --0-1699601947-1098587221=3D:57638 Content-Type: text/html; charset=3Dus-ascii <DIV>On Solaris 2.8 I am using the following code to make a Secure FTP= connection with key encryption. When the perl program is done, I find a= core file on the target FTP server this program did a FTP Connection= to. When I did a "file core" command on the core file, it indicates the= perl program did an auto exit which caused this core dump. Since SFTP= interface does not have a $FTP_HANDLE->close call like in the FTP= module. Has anyone experienced this problem, how can I provide a normal= exit.</DIV> <DIV> </DIV> <DIV>Thank you for help in advance,</DIV> <DIV>Srinivasan</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Here is the code I use to connect to a remote server, put a test file= and close the program:</DIV> <DIV> </DIV> <DIV>my $TestFile =3D "abc.txt";</DIV> <DIV>$TargetPathAndFile =3D "/home/aUser";</DIV> <DIV>my %keyValuePair =3D ("user", "aUSER",= password","APassword","debug","1");<BR>my $sftp =3D= Net::SFTP->new("$myServer", keyValuePair);<BR> if (!= $sftp)<BR> {<BR>  = ; my $ErrorMsg =3D "Failed connecting to $host:= $!";<BR> print= ($ErrorMsg);<BR> exit= (-1);</DIV> <DIV>}<BR>Trace ("Connected to "$myServer using Secure FTP= Protocol...");<BR>$sftp->put($TestFile, $TargetPathAndFile);</DIV> <DIV>exit(0);</DIV><p> <hr size=3D1>Do you Yahoo!?<br><a href=3D"http://vote.yahoo.com">vote.yahoo.com</a> - Register online to vote= today! --0-1699601947-1098587221=3D:57638-- --__--__-- _______________________________________________ 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 This e-mail and any files transmitted with it are for the sole use of the= intended recipient(s) and may contain confidential and privileged= information. If you are not the intended recipient, please contact the sender by reply= e-mail and destroy all copies of the original message.=0D Any unauthorized review, use, disclosure, dissemination, forwarding,= printing or copying of this email or any action taken in reliance on this= e-mail is strictly=0D prohibited and may be unlawful. Visit us at http://www.cognizant.com |
From: Srinivasan R. <sri...@ya...> - 2004-10-24 03:07:10
|
On Solaris 2.8 I am using the following code to make a Secure FTP connection with key encryption. When the perl program is done, I find a core file on the target FTP server this program did a FTP Connection to. When I did a "file core" command on the core file, it indicates the perl program did an auto exit which caused this core dump. Since SFTP interface does not have a $FTP_HANDLE->close call like in the FTP module. Has anyone experienced this problem, how can I provide a normal exit. Thank you for help in advance, Srinivasan Here is the code I use to connect to a remote server, put a test file and close the program: my $TestFile = "abc.txt"; $TargetPathAndFile = "/home/aUser"; my %keyValuePair = ("user", "aUSER", password","APassword","debug","1"); my $sftp = Net::SFTP->new("$myServer", keyValuePair); if (! $sftp) { my $ErrorMsg = "Failed connecting to $host: $!"; print ($ErrorMsg); exit (-1); } Trace ("Connected to "$myServer using Secure FTP Protocol..."); $sftp->put($TestFile, $TargetPathAndFile); exit(0); --------------------------------- Do you Yahoo!? vote.yahoo.com - Register online to vote today! |
From: Steve S. <sap...@gs...> - 2004-10-23 16:10:28
|
I have ssh and Net::SFTP working in an SSH2 environment (mostly Solaris as a platform). It all works fine except for the methods that return handles. These all return undef with no error or warning messages. I added some debug to the source and can see that each one gets an ID but that the get_handle() call on that ID returns undef. Specifically, I've been trying to get the do_open() and do_opendir() methods to work. Any ideas? Thanks in advance ... -- Steve Sapovits GSI Commerce, Inc. http://www.gsicommerce.com Email: sap...@gs... |
From: nadim <na...@kh...> - 2004-10-21 19:36:31
|
On Thursday 21 October 2004 20:56, Good Times wrote: > is it because of the 'local' and it's affect later on in the code? Exactly. When the SSH module tries to read from the socket, it waits for an EOF which is received 120 seconds later. I must have a timeout set to 2 minutes somewhere. My guess it that the connection is lost after that but the message says 'connected'. Cheers, Nadim. |
From: Good T. <aa...@rd...> - 2004-10-21 18:56:24
|
is it because of the 'local' and it's affect later on in the code? aaron -- Through correctness comes ease -Chiun On Thu, October 21, 2004 3:42 pm, nadim said: > this : > open(FILE, '<', "evaled.pl" ) or die ; > local $/ = undef ; > my $file_body = <FILE> ; > close(FILE) ; > > should be this > { > open(FILE, '<', "evaled.pl" ) or die ; > local $/ = undef ; > my $file_body = <FILE> ; > close(FILE) ; > } > > On Thursday 21 October 2004 09:48, nadim wrote: >> Hi all, >> >> I came across a problem today and I must say that I don't have the >> slightest clue of why things don't work as they should. >> >> In the system I have, I need to let the user setup shells, I could let >> the >> user give data to setup shells but I'd rather get some live objects as >> it >> is easier to not handle the diffrent types of shells I can use (local, >> SSH, >> Telnet) and they might be other shell types only the user knows about. >> As >> long as their shell implements the functions I need it can be whatever. >> >> Creating SSH session is no problem and it has worked properly so far >> (that >> is till last night). Creating SSH sessions through evaled text simply >> doesn't work as it should. I narrowed down the problem to these lines. >> The >> code is for a minimal test to reproduce the problem not the original >> code. >> >> <test.pl> >> use Net::SSH::Perl ; >> >> my $shell = Net::SSH::Perl->new('192.168.1.99', debug => 1); >> undef $shell ; >> >> open(FILE, '<', "evaled.pl" ) or die ; >> local $/ = undef ; >> my $file_body = <FILE> ; >> close(FILE) ; >> >> my $distributor = eval $file_body ; >> die $@ if $@ ; >> </test.pl> >> >> <evaled.pl> >> use Net::SSH::Perl ; >> my $shell = Net::SSH::Perl->new('192.168.1.99', debug => 1); >> </evales.pl> >> >> The first SSH connection takes less than 0.2 seconds but the second one >> (embedded in an eval) takes exactly 120 seconds!!! >> >> khemir.net: Reading configuration data /home/nadim/.ssh/config >> khemir.net: Reading configuration data /etc/ssh_config >> khemir.net: Connecting to localhost, port 22. >> khemir.net: Remote protocol version 1.99, remote software version >> OpenSSH_3.6.1p2 >> khemir.net: Net::SSH::Perl Version 1.25, protocol version 1.5. >> khemir.net: No compat match: OpenSSH_3.6.1p2. >> khemir.net: Connection established. >> khemir.net: Reading configuration data /home/nadim/.ssh/config >> khemir.net: Reading configuration data /etc/ssh_config >> khemir.net: Connecting to localhost, port 22. >> khemir.net: Remote protocol version 1.99, remote software version >> OpenSSH_3.6.1p2 >> khemir.net: Net::SSH::Perl Version 1.25, protocol version 1.5. >> khemir.net: No compat match: OpenSSH_3.6.1p2. >> khemir.net: Connection established. >> real 120.30 >> user 0.07 >> sys 0.00 >> >> >> Any idea? >> >> Cheers, Nadim. >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >> Use IT products in your business? Tell us what you think of them. Give >> us >> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out >> more >> http://productguide.itmanagersjournal.com/guidepromo.tmpl >> _______________________________________________ >> 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: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > |