ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 38)
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: John D. <Joh...@in...> - 2004-02-22 22:52:28
|
I'm trying to replace Net::Telnet with Net::SSH::Perl. I want to open a connection with a pty to a remote box (where the login user executes .profile and starts a legacy DB shell) and let it sit there. Then I simply want to be able to run command after command without re-authenticating. This part is in a socket accept loop and implements a clunky kind of pool of telnet sessions to an arcane DB (no DBI or anything to use). When I ssh->login(), channel 0 starts the shell and sits there, but each ssh->cmd() seems to start over at the ksh or bash or whatever. I can get him to work but only by restarting the DB shell as command with the real DB command as his STDIN (which defeats the purpose of my pool). So, the questions: 1) Can I get channel 0 to do my bidding? 2) - or - Can I suppress multiplexing? 3) - or - Can I somehow use ssh->shell programmatically? It could be that I am simply asking for things not supported by SSH and probably belong in the world of Net::Telnet but any advice would be greatly appreciated! The other thing I tried was ssh->shell but could not seem to defeat his attachment to my STDIN (or write to STDIN behind the scenes). Thanks in advance for any suggestions. John ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------- This e-mail and any attachments thereto are intended only for use by the addressee(s) named herein and may contain proprietary and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify Pos...@IN... and permanently delete the original, any attachments, any copies thereof, and any printouts thereof. |
From: Mark A. F. <mar...@ea...> - 2004-02-19 18:06:55
|
From: Rafe Slattery <raf...@iq...> >If there is a login failure I need to trap it and throw an of my own devising, not exit out completely as is currently happening... Is there any way to do what I want? See the archives. I posted something in the past month about how to trap a different error and take my own action. I don't recall if I posted it to sftp or ssh mailing list. The archives are available from http://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users But, when I click the link to the archives, it gives me an error. Maybe it's a temporary thing. What I did involved using Perl's sig{__WARN__} and performing the sftp action within an "eval" block. Mark |
From: Rafe S. <raf...@iq...> - 2004-02-19 16:46:39
|
Hi there. I'm using Net::SSH::Perl to do non interactive logins to remote servers and run a command ... no surprise there ... However if there is a problem with the username / password combo the program exits with an error about "Permission denied at ./iqstatus_update.pl line 138" If there is a login failure I need to trap it and throw an of my own devising, not exit out completely as is currently happening... Is there any way to do what I want? Regards rafe |
From: Dave R. <au...@ur...> - 2004-02-13 17:33:48
|
On Wed, 11 Feb 2004, Kai Wu wrote: > I have a problem installing Net-SFTP-0.08. Please give some help or > advices if you could. > > > > As pre-requeisite, I installed Net-SSH-Perl-1.24 using ppm. I know it > is installed because when I try to do it again, it shows "Package > 'Net-SSH' is already installed.". However, it seems that the > makefile.pl in Net-SFTP can not find it, giving me a warning > "prerequisite Net::SSH::Perl 1.24 not found.". Would you let me how you > installed that module? Well, it's installable via the CPAN shell, but that doesn't necessarily work so well on Win32. > I seems that ppm doesn't work for Net-SFTP installation, am I right? No idea. You can check the usual PPM sources (activestate, uwinnipeg site, etc.) -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Kai W. <Ka...@gi...> - 2004-02-12 00:16:41
|
I have a problem installing Net-SFTP-0.08. Please give some help or advices if you could. =20 As pre-requeisite, I installed Net-SSH-Perl-1.24 using ppm. I know it is installed because when I try to do it again, it shows "Package 'Net-SSH' is already installed.". However, it seems that the makefile.pl in Net-SFTP can not find it, giving me a warning "prerequisite Net::SSH::Perl 1.24 not found.". Would you let me how you installed that module? =20 I seems that ppm doesn't work for Net-SFTP installation, am I right? =20 Thanks, Kai |
From: Dave R. <au...@ur...> - 2004-02-04 06:12:11
|
On Tue, 3 Feb 2004, Moussavi, Keyvan wrote: > The only error message we observed while we were parsing the file was: > > "input must be 8 bytes long at > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Crypt/DES.pm line 57" > > In fact, this guy shows the same symptoms as us but he's not reading the > passwords from a file: > > http://www.talkaboutprogramming.com/group/comp.lang.perl.moderated/messages/ > 12716.html Is it possible that there's some issue with encodings? Perhaps it's interpreting the file data as UTF-8 for some reason? You can check this with the Encode::is_utf8() sub. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Moussavi, K. <KMo...@PE...> - 2004-02-03 23:20:06
|
By the way, this issue has been resolved. We reinstalled Crypt::DSA.pm and everything worked properly. Keyvan -----Original Message----- From: Moussavi, Keyvan Sent: Tuesday, February 03, 2004 12:12 PM To: 'ssh...@li... ' Cc: Liberty, Ben Subject: [Ssh-sftp-perl-users] NET::SFTP Connectivity Failure Hello, We are trying to use the Net::SFTP perl module to transfer one file from a remote machine. Here is the code we're using: ########################################### use Net::SFTP; $user = "root"; $passwd = "testpass"; $ip = "xxx.xxx.xxx.xxx"; my $sftp = undef; eval{ $sftp = Net::SFTP->new($ip, user=>$user, password=>$passwd, debug=>3 ); }; print "sftp = $sftp\n"; if (! $sftp) { print "I can't connect!\n"; }else{ print "SUCCESS!\n"; } $sftp->get($remoteFile, $localFile); ########################################### I get the following error: ########################################### [root@MGWConfigServer scripts.d]# ./getConfig.pl Remote file =/usr/axxxxxxxx-9-backupfile.tar Local file = /home/MGW-configs/axxxxxxxxx/9/axxxxxxxxx-9-backupfile.tar MGWConfigServer: Reading configuration data /root/.ssh/config MGWConfigServer: Reading configuration data /etc/ssh_config MGWConfigServer: Allocated local port 1022. MGWConfigServer: Connecting to xxx.xxx.xxx.xxx, port 22. MGWConfigServer: Remote protocol version 1.99, remote software version OpenSSH_3.5p1 MGWConfigServer: Net::SSH::Perl Version 1.23, protocol version 2.0. MGWConfigServer: No compat match: OpenSSH_3.5p1. MGWConfigServer: Connection established. MGWConfigServer: Sent key-exchange init (KEXINIT), wait response. MGWConfigServer: Algorithms, c->s: 3des-cbc hmac-sha1 none MGWConfigServer: Algorithms, s->c: 3des-cbc hmac-sha1 none MGWConfigServer: Entering Diffie-Hellman Group 1 key exchange. MGWConfigServer: Sent DH public key, waiting for reply. sftp = I can't connect! Can't call method "get" on an undefined value at <line in script>.... [root@xxxxxServer scripts.d]# ####################################### Any assistance in resolving this matter is highly appreciated. The value of $sftp is blank. Keyvan ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Ssh-sftp-perl-users mailing list Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Moussavi, K. <KMo...@PE...> - 2004-02-03 23:13:05
|
Hello, We are trying to use the Net::SFTP perl module to transfer one file from a remote machine. Here is the code we're using: ########################################### use Net::SFTP; $user = "root"; $passwd = "testpass"; $ip = "xxx.xxx.xxx.xxx"; my $sftp = undef; eval{ $sftp = Net::SFTP->new($ip, user=>$user, password=>$passwd, debug=>3 ); }; print "sftp = $sftp\n"; if (! $sftp) { print "I can't connect!\n"; }else{ print "SUCCESS!\n"; } $sftp->get($remoteFile, $localFile); ########################################### I get the following error: ########################################### [root@MGWConfigServer scripts.d]# ./getConfig.pl Remote file =/usr/axxxxxxxx-9-backupfile.tar Local file = /home/MGW-configs/axxxxxxxxx/9/axxxxxxxxx-9-backupfile.tar MGWConfigServer: Reading configuration data /root/.ssh/config MGWConfigServer: Reading configuration data /etc/ssh_config MGWConfigServer: Allocated local port 1022. MGWConfigServer: Connecting to xxx.xxx.xxx.xxx, port 22. MGWConfigServer: Remote protocol version 1.99, remote software version OpenSSH_3.5p1 MGWConfigServer: Net::SSH::Perl Version 1.23, protocol version 2.0. MGWConfigServer: No compat match: OpenSSH_3.5p1. MGWConfigServer: Connection established. MGWConfigServer: Sent key-exchange init (KEXINIT), wait response. MGWConfigServer: Algorithms, c->s: 3des-cbc hmac-sha1 none MGWConfigServer: Algorithms, s->c: 3des-cbc hmac-sha1 none MGWConfigServer: Entering Diffie-Hellman Group 1 key exchange. MGWConfigServer: Sent DH public key, waiting for reply. sftp = I can't connect! Can't call method "get" on an undefined value at <line in script>.... [root@xxxxxServer scripts.d]# ####################################### Any assistance in resolving this matter is highly appreciated. The value of $sftp is blank. Keyvan |
From: Moussavi, K. <KMo...@PE...> - 2004-02-03 13:26:52
|
Dave, The only error message we observed while we were parsing the file was: "input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Crypt/DES.pm line 57" In fact, this guy shows the same symptoms as us but he's not reading the passwords from a file: http://www.talkaboutprogramming.com/group/comp.lang.perl.moderated/messages/ 12716.html Thanks very much, Keyvan -----Original Message----- From: Dave Rolsky [mailto:au...@ur...] Sent: Monday, February 02, 2004 8:52 PM To: Mark Fuller Cc: Moussavi, Keyvan; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Using Net::SSH:Perl login() On Mon, 2 Feb 2004, Mark Fuller wrote: > If I understand correctly, this would cause me to believe there is > *something* different about the file (or the result of the split) than you > believe. Maybe the file has trailing carriage returns in addition to a > normal lineend and the chomp isn't getting it? Use the MD5 digest function > to get a digest value of each value (your constant assignment and the value > coming from the file after it's in the array). That would tell you if it's > different. Or echo it to the "od -oc" command (on unix) to view the binary > data. I have to believe something is different about the two values. Yes, I agree. The only other possibility is that getting the PW from the file causes it to be tainted. But if that were the case then I'd expect that the error message would clearly indicate that taint mode was involved. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Moussavi, K. <KMo...@PE...> - 2004-02-03 13:19:50
|
Mr. Fuller, That is correct. Running "od" did not reveal anything hence why I'm very confused. As a workaround (it's very ugly) we created a multidimensional array in a separate script and placed a "require" statement in the original script. Here is an example of our array: $array[0] = ("name of site","site IP","machine type","password","phase"); $array[1] = ....... $array[2] = ....... . . . This works.... Again, there are no funny characters in the original text file. It would be nice if we could simply parse a text file rather than have to create such funny arrays. Have you guys been able to do so? Thanks, Keyvan -----Original Message----- From: Mark Fuller [mailto:mar...@ea...] Sent: Monday, February 02, 2004 8:48 PM To: Moussavi, Keyvan; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Using Net::SSH:Perl login() >However, this script works if instead of reading the password from a file we > explicitly assign the password string to $password (e.g. $password = > "testpass"). Do I understand correctly that assigning the value from an array (which came from a split, which operated on data read from a file) doesn't work? But, if you assign the same value (which you believe is in that array) directly to the same variable (as a constant) it does work? If I understand correctly, this would cause me to believe there is *something* different about the file (or the result of the split) than you believe. Maybe the file has trailing carriage returns in addition to a normal lineend and the chomp isn't getting it? Use the MD5 digest function to get a digest value of each value (your constant assignment and the value coming from the file after it's in the array). That would tell you if it's different. Or echo it to the "od -oc" command (on unix) to view the binary data. I have to believe something is different about the two values. Mark ----- Original Message ----- From: "Moussavi, Keyvan" <KMo...@PE...> To: <ssh...@li...> Cc: "Liberty, Ben" <ben...@pe...> Sent: Monday, February 02, 2004 11:54 AM Subject: [Ssh-sftp-perl-users] Using Net::SSH:Perl login() > Hello, > > We've installed the Net::SSH::Perl module on a Red Hat 9 machine and are > interested in using this module to SSH to several different machines on a > nightly basis. We parse a file and gather passwords/IP addresses then > proceed to connect to the remote machines. We are using the module in the > following manner: > > use Net::SSH::Perl; > > @lineArray = `/bin/cat $file`; > foreach $line (@lineArray) { > chomp $line; > @tempStringArray = split(/\s+/,$line); > $password = $tempStringArray[3]; # value grabbed from password > file. > $ssh->login("root",$password); > ($stdout, $stderr, $exit) = $ssh->cmd("ls -l"); > . > . > . > } > > Once the script is executed we observe an error message related to DES.pm. > However, this script works if instead of reading the password from a file we > explicitly assign the password string to $password (e.g. $password = > "testpass"). How is it that the latter method works and how can we modify > our script so that we can read password strings from a file rather than > hard-coding passwords in the script? > > Much thanks, > > Keyvan Moussavi > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Dave R. <au...@ur...> - 2004-02-03 01:52:11
|
On Mon, 2 Feb 2004, Mark Fuller wrote: > If I understand correctly, this would cause me to believe there is > *something* different about the file (or the result of the split) than you > believe. Maybe the file has trailing carriage returns in addition to a > normal lineend and the chomp isn't getting it? Use the MD5 digest function > to get a digest value of each value (your constant assignment and the value > coming from the file after it's in the array). That would tell you if it's > different. Or echo it to the "od -oc" command (on unix) to view the binary > data. I have to believe something is different about the two values. Yes, I agree. The only other possibility is that getting the PW from the file causes it to be tainted. But if that were the case then I'd expect that the error message would clearly indicate that taint mode was involved. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mark F. <mar...@ea...> - 2004-02-03 01:47:46
|
>However, this script works if instead of reading the password from a file we > explicitly assign the password string to $password (e.g. $password = > "testpass"). Do I understand correctly that assigning the value from an array (which came from a split, which operated on data read from a file) doesn't work? But, if you assign the same value (which you believe is in that array) directly to the same variable (as a constant) it does work? If I understand correctly, this would cause me to believe there is *something* different about the file (or the result of the split) than you believe. Maybe the file has trailing carriage returns in addition to a normal lineend and the chomp isn't getting it? Use the MD5 digest function to get a digest value of each value (your constant assignment and the value coming from the file after it's in the array). That would tell you if it's different. Or echo it to the "od -oc" command (on unix) to view the binary data. I have to believe something is different about the two values. Mark ----- Original Message ----- From: "Moussavi, Keyvan" <KMo...@PE...> To: <ssh...@li...> Cc: "Liberty, Ben" <ben...@pe...> Sent: Monday, February 02, 2004 11:54 AM Subject: [Ssh-sftp-perl-users] Using Net::SSH:Perl login() > Hello, > > We've installed the Net::SSH::Perl module on a Red Hat 9 machine and are > interested in using this module to SSH to several different machines on a > nightly basis. We parse a file and gather passwords/IP addresses then > proceed to connect to the remote machines. We are using the module in the > following manner: > > use Net::SSH::Perl; > > @lineArray = `/bin/cat $file`; > foreach $line (@lineArray) { > chomp $line; > @tempStringArray = split(/\s+/,$line); > $password = $tempStringArray[3]; # value grabbed from password > file. > $ssh->login("root",$password); > ($stdout, $stderr, $exit) = $ssh->cmd("ls -l"); > . > . > . > } > > Once the script is executed we observe an error message related to DES.pm. > However, this script works if instead of reading the password from a file we > explicitly assign the password string to $password (e.g. $password = > "testpass"). How is it that the latter method works and how can we modify > our script so that we can read password strings from a file rather than > hard-coding passwords in the script? > > Much thanks, > > Keyvan Moussavi > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Moussavi, K. <KMo...@PE...> - 2004-02-02 18:54:30
|
Hello, We've installed the Net::SSH::Perl module on a Red Hat 9 machine and are interested in using this module to SSH to several different machines on a nightly basis. We parse a file and gather passwords/IP addresses then proceed to connect to the remote machines. We are using the module in the following manner: use Net::SSH::Perl; @lineArray = `/bin/cat $file`; foreach $line (@lineArray) { chomp $line; @tempStringArray = split(/\s+/,$line); $password = $tempStringArray[3]; # value grabbed from password file. $ssh->login("root",$password); ($stdout, $stderr, $exit) = $ssh->cmd("ls -l"); . . . } Once the script is executed we observe an error message related to DES.pm. However, this script works if instead of reading the password from a file we explicitly assign the password string to $password (e.g. $password = "testpass"). How is it that the latter method works and how can we modify our script so that we can read password strings from a file rather than hard-coding passwords in the script? Much thanks, Keyvan Moussavi |
From: Dave R. <au...@ur...> - 2004-02-02 02:49:05
|
On Sun, 1 Feb 2004, Mark Fuller wrote: > I've decided to use this to determine if errors occured: > > ==================================== > my @warnings; > > $SIG{'__WARN__'} = sub { $warnings[$#warnings + 1] = $_[0]; }; > eval {$pwd = $sftp->do_realpath(".");}; > $SIG{'__WARN__'} = 'DEFAULT'; > > if ($#warnings > -1 or (!defined($pwd) or $pwd eq '') ) { > # treat it as an error, display each row of @array > } > ==================================== > > That might be a bad example. It seems like all the "do_" methods reliably > return something indicating a bad execution. Where I have difficulty is with > "get" or "put". I can't tell how to detect a failure without capturing > warnings and checking them. This is probably the only way to do this right now. > If anyone knows a better way, I'd like to know about it. I was hoping for a > method like Net::FTP's "object->message" or a positive or negative return > from get/put. Yeah, I need to look through the code and find a comprehensive error return solution for all the public methods. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mark F. <mar...@ea...> - 2004-02-01 22:40:53
|
I've decided to use this to determine if errors occured: ==================================== my @warnings; $SIG{'__WARN__'} = sub { $warnings[$#warnings + 1] = $_[0]; }; eval {$pwd = $sftp->do_realpath(".");}; $SIG{'__WARN__'} = 'DEFAULT'; if ($#warnings > -1 or (!defined($pwd) or $pwd eq '') ) { # treat it as an error, display each row of @array } ==================================== That might be a bad example. It seems like all the "do_" methods reliably return something indicating a bad execution. Where I have difficulty is with "get" or "put". I can't tell how to detect a failure without capturing warnings and checking them. If anyone knows a better way, I'd like to know about it. I was hoping for a method like Net::FTP's "object->message" or a positive or negative return from get/put. Thanks! Mark ----- Original Message ----- From: "Mark Fuller" <mar...@ea...> To: <ssh...@li...> Sent: Friday, January 30, 2004 3:08 PM Subject: [Ssh-sftp-perl-users] Determining sftp failure? > How can I determine if a ->put() (or other operation) failed? It seems like > sftp issues a warn but doesn't set a return code. I think a put returns a > "0" on success and "" on failures. "ls" returns the number of lines listed. > A "0" could mean an error? > > Is there a way to get access to the error messages sftp writes to the > terminal? > > Thanks, > Mark > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Dave R. <au...@ur...> - 2004-01-31 03:57:57
|
On Thu, 29 Jan 2004, Mark A. Fuller wrote: > $sftp = Net::SFTP->new('some.host.name', > ( user => 'user', > ssh_args => ( ([ identity_files => ([ '/home/user/.ssh/ident_file' ]) ]) ) > ) > ); > > That was another thing that was not intuitive to me. If the POD gave an > example, it would be very useful. Actually, I want to change it so that ssh_args also accepts a hash ref, which would be a lot more sane, I think. AFAICT, there's no reason to make it an array reference. Now if only that shipment of round tuits would arrive ... -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mark A. F. <mar...@ea...> - 2004-01-31 03:03:22
|
How is "cd" supposed to work with Perl sftp? I cd somewhere, but the realpath for "." doesn't change. If I put a file without a path, it goes to the pre-cd path. I looked at psftp and it appears I need to maintain my own "pwd" and use it with any command. Is this true? In other words, I have to keep track of pwd? It's not a state within sftp? I'd like to suggest the POD mention this. It wasn't intuitive to me. Also, Dave you may recall I emailed you around Thanksgiving about how to specify the identity file (how to specify ssh args to sftp). It's done like this: $sftp = Net::SFTP->new('some.host.name', ( user => 'user', ssh_args => ( ([ identity_files => ([ '/home/user/.ssh/ident_file' ]) ]) ) ) ); That was another thing that was not intuitive to me. If the POD gave an example, it would be very useful. Thanks, Mark |
From: Mark F. <mar...@ea...> - 2004-01-30 22:08:16
|
How can I determine if a ->put() (or other operation) failed? It seems like sftp issues a warn but doesn't set a return code. I think a put returns a "0" on success and "" on failures. "ls" returns the number of lines listed. A "0" could mean an error? Is there a way to get access to the error messages sftp writes to the terminal? Thanks, Mark |
From: Mark F. <mar...@ea...> - 2004-01-30 22:03:11
|
[I posted this yesterday and didn't see it come out on the list]How is "cd" supposed to work with Perl sftp? I cd somewhere, but the realpath for "." doesn't change. If I put a file without a path, it goes to the pre-cd path. I looked at psftp and it appears I need to maintain my own "pwd" and use it with any command. Is this true? In other words, I have to keep track of pwd? It's not a state within sftp? I'd like to suggest the POD mention this. It wasn't intuitive to me. Also, Dave you may recall I emailed you around Thanksgiving about how to specify the identity file (how to specify ssh args to sftp). It's done like this: $sftp = Net::SFTP->new('some.host.name', ( user => 'user', ssh_args => ( ([ identity_files => ([ '/home/user/.ssh/ident_file' ]) ]) ) ) ); That was another thing that was not intuitive to me. If the POD gave an example, it would be very useful. Thanks, Mark |
From: Dave R. <au...@ur...> - 2003-12-03 17:41:34
|
On Wed, 3 Dec 2003, J=FCrg Hauser wrote: > Is there a way to close a Net::SFTP connection within a perl script? Short of undefining the Net::SFTP object, no, not yet. That's a big todo item. -dave /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D House Absolute Consulting www.houseabsolute.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ |
From: <jue...@kr...> - 2003-12-03 17:31:33
|
Hi, Is there a way to close a Net::SFTP connection within a perl script? Thanks Juerg |
From: Dave R. <au...@ur...> - 2003-12-03 15:54:55
|
On Tue, 2 Dec 2003, fred stiler wrote: > im working on a script that uses Net::SSH::Perl > The problem is that i dont know how to handle errors properly. > When the script tries to connect to a host that has no sshd running > or is completly down then the script exits with a error like: > > Can't connect to x.x.x.x, port 22: Connection timed out at > /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl.pm line 206. > > but it would be much nicer if the error would be stored in a var and > the script continues. > Or at least it should die with a proper message. > i tried something like: > > $ssh = Net::SSH::Perl->new($host) || die "error connecting to $host"; Try this: eval { $ssh = Net::SSH::Perl->new($host) }; die $@ if $@; I can't just go and change the module not to die, because that would break backwards compatibility. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Dave R. <au...@ur...> - 2003-12-03 15:53:58
|
Can you do me a favor and report this via rt.cpan.org at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=net%3A%3Assh%3A%3Aperl ? More than one person will be working on maintenance for this module, so having real bug tracking is important. Thanks, -dave On Mon, 1 Dec 2003, Roland Gruber wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I have problems executing multiple commands with the cmd() function. > Only the first command is executed correctly. The others are ignored and > the return values of cmd() are all empty. > > Here is an example code: > > my $ssh = Net::SSH::Perl->new($hostname, > options=>["UserKnownHostsFile /dev/null"], > protocol => "2,1", > debug => true ); > $ssh->login($username, $password); > for ($i=0; $i<=30; $i++) { > ($stdout, $stderr, $exit) = $ssh->cmd("touch /tmp/test$i"); > } > > > The debug output: > > Roland: Reading configuration data /home/roland/.ssh/config > Roland: Reading configuration data /etc/ssh_config > Roland: Connecting to localhost, port 22. > Roland: Remote protocol version 2.0, remote software version > OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9 > Roland: Net::SSH::Perl Version 1.24, protocol version 2.0. > Roland: No compat match: OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9. > Roland: Connection established. > Roland: Sent key-exchange init (KEXINIT), wait response. > Roland: Algorithms, c->s: 3des-cbc hmac-sha1 none > Roland: Algorithms, s->c: 3des-cbc hmac-sha1 none > Roland: Entering Diffie-Hellman Group 1 key exchange. > Roland: Sent DH public key, waiting for reply. > Roland: Received host key, type 'ssh-dss'. > Roland: Permanently added 'localhost' to the list of known hosts. > Roland: Computing shared secret key. > Roland: Verifying server signature. > Roland: Waiting for NEWKEYS message. > Roland: Enabling incoming encryption/MAC/compression. > Roland: Send NEWKEYS, enable outgoing encryption/MAC/compression. > Roland: Sending request for user-authentication service. > Roland: Service accepted: ssh-userauth. > Roland: Trying empty user-authentication request. > Roland: Authentication methods that can continue: > publickey,password,keyboard-interactive. > Roland: Next method to try is publickey. > Roland: Publickey: testing agent key '/home/roland/.ssh/id_dsa' > Roland: Authentication methods that can continue: > publickey,password,keyboard-interactive. > Roland: Next method to try is publickey. > Roland: Trying pubkey authentication with key file > '/home/roland/.ssh/id_dsa' > Roland: Will not query passphrase for '/home/roland/.ssh/id_dsa' in > batch mode. > Roland: Loading private key failed. > Roland: Next method to try is password. > Roland: Trying password authentication. > Roland: Login completed, opening dummy shell channel. > Roland: channel 0: new [client-session] > Roland: Requesting channel_open for channel 0. > Roland: channel 0: open confirm rwindow 0 rmax 32768 > Roland: Got channel open confirmation, requesting shell. > Roland: Requesting service shell on channel 0. > Roland: channel 1: new [client-session] > Roland: Requesting channel_open for channel 1. > Roland: Entering interactive session. > Roland: Sending command: touch /tmp/o1/test0 > Roland: Requesting service exec on channel 1. > Roland: channel 1: open confirm rwindow 0 rmax 32768 > Roland: input_channel_request: rtype exit-status reply 0 > Roland: channel 1: rcvd eof > Roland: channel 1: output open -> drain > Roland: channel 1: rcvd close > Roland: channel 1: input open -> closed > Roland: channel 1: close_read > Roland: channel 1: obuf empty > Roland: channel 1: output drain -> closed > Roland: channel 1: close_write > Roland: channel 1: send close > Roland: channel 1: full closed > Roland: channel 2: new [client-session] > Roland: Requesting channel_open for channel 2. > Roland: Entering interactive session. > Roland: channel 3: new [client-session] > Roland: Requesting channel_open for channel 3. > > > My Perl version is 5.8.0, Net::SSH::Perl is 1.24 running on Debian Sarge. > > > Thanks, > Roland > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (GNU/Linux) > Comment: Using GnuPG with Debian - http://enigmail.mozdev.org > > iD8DBQE/y0tBq/ywNCsrGZ4RAsEpAJ4unbBr7MvfwIz6Bfh2pX2wa6w8EQCfd9qV > XvZqw2BQ1dYE9Zmtsp0cl1A= > =/u87 > -----END PGP SIGNATURE----- > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: fred s. <Fre...@6p...> - 2003-12-02 13:32:13
|
Hi im working on a script that uses Net::SSH::Perl The problem is that i dont know how to handle errors properly. When the script tries to connect to a host that has no sshd running=20 or is completly down then the script exits with a error like: Can't connect to x.x.x.x, port 22: Connection timed out at /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl.pm line 206. but it would be much nicer if the error would be stored in a var and the script continues. Or at least it should die with a proper message. i tried something like: $ssh =3D Net::SSH::Perl->new($host) || die "error connecting to $host"; but had no success :/ any help is welcome twix -- http://www.tuxhilfe.de.vu _____________________________________________________________ ---------------------------------------- Kein Freibier - aber kostenlose Email ;-) http://www.6pack.de --- Webhosting G=C3=BCnstig und zuverl=C3=A4ssig: http://www.kissl.de |
From: Roland G. <gr...@in...> - 2003-12-01 14:08:59
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I have problems executing multiple commands with the cmd() function. Only the first command is executed correctly. The others are ignored and the return values of cmd() are all empty. Here is an example code: my $ssh = Net::SSH::Perl->new($hostname, options=>["UserKnownHostsFile /dev/null"], protocol => "2,1", debug => true ); $ssh->login($username, $password); for ($i=0; $i<=30; $i++) { ($stdout, $stderr, $exit) = $ssh->cmd("touch /tmp/test$i"); } The debug output: Roland: Reading configuration data /home/roland/.ssh/config Roland: Reading configuration data /etc/ssh_config Roland: Connecting to localhost, port 22. Roland: Remote protocol version 2.0, remote software version OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9 Roland: Net::SSH::Perl Version 1.24, protocol version 2.0. Roland: No compat match: OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9. Roland: Connection established. Roland: Sent key-exchange init (KEXINIT), wait response. Roland: Algorithms, c->s: 3des-cbc hmac-sha1 none Roland: Algorithms, s->c: 3des-cbc hmac-sha1 none Roland: Entering Diffie-Hellman Group 1 key exchange. Roland: Sent DH public key, waiting for reply. Roland: Received host key, type 'ssh-dss'. Roland: Permanently added 'localhost' to the list of known hosts. Roland: Computing shared secret key. Roland: Verifying server signature. Roland: Waiting for NEWKEYS message. Roland: Enabling incoming encryption/MAC/compression. Roland: Send NEWKEYS, enable outgoing encryption/MAC/compression. Roland: Sending request for user-authentication service. Roland: Service accepted: ssh-userauth. Roland: Trying empty user-authentication request. Roland: Authentication methods that can continue: publickey,password,keyboard-interactive. Roland: Next method to try is publickey. Roland: Publickey: testing agent key '/home/roland/.ssh/id_dsa' Roland: Authentication methods that can continue: publickey,password,keyboard-interactive. Roland: Next method to try is publickey. Roland: Trying pubkey authentication with key file '/home/roland/.ssh/id_dsa' Roland: Will not query passphrase for '/home/roland/.ssh/id_dsa' in batch mode. Roland: Loading private key failed. Roland: Next method to try is password. Roland: Trying password authentication. Roland: Login completed, opening dummy shell channel. Roland: channel 0: new [client-session] Roland: Requesting channel_open for channel 0. Roland: channel 0: open confirm rwindow 0 rmax 32768 Roland: Got channel open confirmation, requesting shell. Roland: Requesting service shell on channel 0. Roland: channel 1: new [client-session] Roland: Requesting channel_open for channel 1. Roland: Entering interactive session. Roland: Sending command: touch /tmp/o1/test0 Roland: Requesting service exec on channel 1. Roland: channel 1: open confirm rwindow 0 rmax 32768 Roland: input_channel_request: rtype exit-status reply 0 Roland: channel 1: rcvd eof Roland: channel 1: output open -> drain Roland: channel 1: rcvd close Roland: channel 1: input open -> closed Roland: channel 1: close_read Roland: channel 1: obuf empty Roland: channel 1: output drain -> closed Roland: channel 1: close_write Roland: channel 1: send close Roland: channel 1: full closed Roland: channel 2: new [client-session] Roland: Requesting channel_open for channel 2. Roland: Entering interactive session. Roland: channel 3: new [client-session] Roland: Requesting channel_open for channel 3. My Perl version is 5.8.0, Net::SSH::Perl is 1.24 running on Debian Sarge. Thanks, Roland -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Debian - http://enigmail.mozdev.org iD8DBQE/y0tBq/ywNCsrGZ4RAsEpAJ4unbBr7MvfwIz6Bfh2pX2wa6w8EQCfd9qV XvZqw2BQ1dYE9Zmtsp0cl1A= =/u87 -----END PGP SIGNATURE----- |