ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 23)
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: Phillip C. <phi...@gm...> - 2006-03-19 21:25:40
|
TmV3LCBjbGVhbiAxLjI5IE5ldDo6U1NIOlBlcmwgb24gQ2VudE9TIGJveC4gV29ya2luZyBvbiBi dWlsZGluZyB0b29scyB0bwpoZWxwIG1hbmFnZSAyMDAwKyBzZXJ2ZXJzIC4uLiBzb21lIHNlcnZl cnMgbWlnaHQgb2J2aW91c2x5IGJlIGRvd24gYXQgc29tZQphcmJpdHJhcnkgcG9pbnQgaW4gdGlt ZS4gQ3VycmVudCwgd2hlbiBteSB0ZXN0IHNjcmlwdCB0cmllcyB0byBhY2Nlc3MgYSBkb3duCnNl cnZlciAoZWl0aGVyIGRvd24gaGFyZCwgbm8gcGluZywgb3Igc3NoZCBkb3duKSwgaXQganVzdCBI QU5HUy4gTm90ZSBJJ20KdXNpbmcgYSBub24tc3RhbmRhcmQgU1NIIHBvcnQgKHJlcXVpcmVkLCBs b2NhbCBwb2xpY3kpLCBidXQgYWxsIGhvc3RzIHNlZW0KdG8gd29yayBmaW5lIHdoZW4gdXAuCgpE ZWJ1ZyBvdXRwdXQgbG9va3MgbGlrZSB0aGlzOgojL3RtcC90ZXN0My5wbCB1c2VybmFtZSBob3N0 bmFtZQpmb286IFJlYWRpbmcgY29uZmlndXJhdGlvbiBkYXRhIC9yb290Ly5zc2gvY29uZmlnCmZv bzogUmVhZGluZyBjb25maWd1cmF0aW9uIGRhdGEgL2V0Yy9zc2hfY29uZmlnCmZvbzogQWxsb2Nh dGVkIGxvY2FsIHBvcnQgMTAyMy4KZm9vOiBDb25uZWN0aW5nIHRvIGhvc3RuYW1lLCBwb3J0IDQ1 Ni4KQ2FuJ3QgY29ubmVjdCB0byBob3N0YW5lbSwgcG9ydCA0NTY6CiAgIENvbm5lY3Rpb24gdGlt ZWQgb3V0IGF0IC91c3IvbGliL3Blcmw1L3NpdGVfcGVybC81LjguNS9OZXQvU1NIL1BlcmwucG0K bGluZSAyMDguCgoKVGhpcyB0YWtlcyBhYm91dCA1IG1pbnV0ZXMsIHdoaWNoIGlzIG9idmlvdXNs eSBhIHByb2JsZW0gLi4uIEFsbCBob3N0cyBhcmUKb24gMTAwLzEwMDAgZXRoZXJuZXQgYW5kIG5v dCBtb3JlIHRoYW4gMi01MG1zIGF3YXkgYnkgcGluZy4gVGhlc2UgYXJlIHRoZQpTU0ggb3B0aW9u cyBJJ20gdXNpbmcgLi4uIEkgdGhvdWdodCB0aGlzIHdvdWxkIGdpdmUgYSBhIDJzZWMgdGltZW91 dCwgYnV0Cml0J3Mgbm90IHdvcmtpbmcgLi4uCgpteSAlcGFyYW1zID0gKAogICAgICAgIHBvcnQg PT4gNDU2LAogICAgICAgIHByb3RvY29sID0+IDIsCiAgICAgICAgaW50ZXJhY3RpdmUgPT4gMCwK ICAgICAgICB1c2VfcHR5ID0+IDAsCiAgICAgICAgZGVidWcgPT4gMSwKICAgICAgICBvcHRpb25z ID0+IFsKICAgICAgICAgICAgICAgICJDb25uZWN0VGltZW91dD0yIiwKICAgICAgICAgICAgICAg ICJCYXRjaE1vZGUgeWVzIiwKICAgICAgICAgICAgICAgICJBdXRoZW50aWNhdGlvblN1Y2Nlc3NN c2cgbm8iLAogICAgICAgICAgICAgICAgIkZvcndhcmRYMTEgbm8iLAogICAgICAgICAgICAgICAg IkZvcndhcmRBZ2VudCBubyIKICAgICAgICAgXQopOwoKCgpOZWVkIEhlbHAhIEkgYW0gbmV3IHRv IFBlcmwsIGJ1dCBJIHRoaW5rIEkgY2FuIHdyaXRlIHRoZSBwcm9wZXIgcmVzcG9uc2UgdG8KdGhl IHRpbWVvdXQgLS0ganVzdCBpdCdzIG5vdCBldmVuIGRldGVjdGluZyB0aGUgdGltZW91dCEhISBX aGF0IGFtIEkgZG9pbmcKd3JvbmcgaGVyZT8/Pz8/ICA6LSkKCi0tLS0tClBoaWwgQ29yY2hhcnkK RGVudmVyLCBDb2xvcmFkbwpwaGlsbGlwID1kb3Q9IGNvcmNoYXJ5IDxhdD4gZ21haWwgPWRvdD0g Y29tCg== |
From: David R. <dbr...@cp...> - 2006-03-18 08:12:54
|
After CPAN has indexed these new uploads they will be available from my CPAN page at http://search.cpan.org/~dbrobins. The changes for each are: Net::SSH2: 0.07 2006-03-17 dbr (svn revision 44) - Remove incorrect statement that poll with timeout of 0 will block. - Fix scp_put read size (fix by Pier Hegeman, rt.cpan.org #17370). - Fix Win32 check (rt.cpan.org #17656). - Fix scp_get buffer overrun (Rutger Ovidus, rt.cpan.org #16886). - Update Net::SSH2 SYNOPSIS (thanks to Roy Smith). - NOTE: CPAN alias AWA (Vandana Awasthi) released an unauthorized "0.07" version of Net::SSH2; you can recognize it because it says 0.06 in the changelog. I have not been able to contact AWA. Net::SSH::Perl (there is no Net::SFTP update at this time): 1.30 2006.03.17 - Fix for local *READ/*WRITE tie problem in open2 function (Bas van Sisseren). - Add back 'use IO::Socket' to fix 'Can't locate object method "blocking" via package "IO::Handle"' error (rt.cpan.org #15102). - Allow "The socket is already in use" as well as "Address already in use" to detect port already in use (for AIX, rt.cpan.org #16301). - Use sysread (not <>) to read the version string to avoid mixing read types and allow pre-version data (fix by Denis Bider, rt.cpan.org #14812). - Fix warnings on empty hostfile lines (fix by JOHANL, rt.cpan.org #13750). - Get the user's home directory from getpwuid() if the HOME environment variable isn't set (rt.cpan.org #13434). Thanks to everyone who contributed patches and reported bugs. -- Dave Isa. 40:31 |
From: Bryan B. <br...@bu...> - 2006-03-17 15:09:34
|
> > # file libssh2-0.12/src/libssh2.so > > libssh2-0.12/src/libssh2.so: ELF 64-bit LSB shared object, AMD x86-64, > version 1 (SYSV), not stripped Since your libssh2.so file built as 64-bit, you shouldnt need to modify the way you made it. It should be ready for Net::SSH2 > > > Instalation of libssh2-0.12: > > > /usr/bin/install -c libssh2.so /usr/local/lib > > make[1]: Leaving directory > `/home/config/Modulos_Perl/Net-SSH2/libssh2-0.12/src' > > /usr/bin/install -c -m 644 include/libssh2.h /usr/local/include/ > > /usr/bin/install -c -m 644 include/libssh2_sftp.h /usr/local/include/ > > /usr/bin/install -c -m 644 include/libssh2_publickey.h > /usr/local/include/ > So libssh2.so is in /usr/local/lib, check /etc/ld.so.conf and make sure /usr/local/lib is included, then run "ldconfig" as root. > Gor me, it seems that libssh2 is installed. > > But if I do this again: > > > > # ldd Net-SSH2-0.06/blib/arch/auto/Net/SSH2/SSH2.so > > libssh2.so => not found > > libc.so.6 => /lib64/libc.so.6 (0x00002aaaaabdf000) > > /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) > > > > > > What can I do to install Net::SSH2? I really need this module for some > scripts I'm creating, can anyone show me what I might try? I really > don't know how to make this work... > > > It looks like Net::SSH2 was smart enough to build with -L/usr/local/lib, but your system doesnt recognize it as a library search path. Try the ldconfig i mentioned and run your install of Net::SSH2 again. Hope that helps. Bryan http://sourceforge.net/projects/rover |
From: David R. <dbr...@cp...> - 2006-03-17 05:44:29
|
On Thursday March 16, 2006 07:27, smi...@em... wrote: > I'm confused as to what the current version is. >=20 > When you go to http://search.cpan.org/~awa/Net-SSH2/lib/Net/SSH2.pm, it s= ays > "Module Version: 0.06", but also has a link "Download: > AWA/Net-SSH2-0.07.tar.gz". When I downloadNet-SSH2-0.07.tar.gz and unpack > it, the latest entry in the Changes file is for 0.06. >=20 > At http://search.cpan.org/~awa/Net-SSH2/, it says, "This Release > Net-SSH2-0.07" with a date of "11 Feb 2006", but you say in your mail, > "changes will be in 0.07", which sounds like it's not released yet. I have no idea who AWA is but that version isn't official or supported by a= ny=20 means. =A0I'm the original author and current maintainer of Net::SSH2 and I= 've=20 registered the namespace (see http://search.cpan.org/~dbrobins/). I've emailed aw...@cp... asking that he remove his Net::SSH2 module, but t= he=20 mail bounced; I'll see what the CPAN maintainers can do about it. The current released version is 0.06. I have 0.07 ready to release shortly which is why I will say "changes will = be=20 in 0.07" in reply to various fixes in rt.cpan.org; it means I've made and=20 verified the change locally. =2D-=20 Dave Isa. 40:31 |
From: David R. <dbr...@cp...> - 2006-03-17 05:42:28
|
On Thursday March 16, 2006 07:27, smi...@em... wrote: > I'm confused as to what the current version is. >=20 > When you go to http://search.cpan.org/~awa/Net-SSH2/lib/Net/SSH2.pm, it s= ays > "Module Version: 0.06", but also has a link "Download: > AWA/Net-SSH2-0.07.tar.gz". When I downloadNet-SSH2-0.07.tar.gz and unpack > it, the latest entry in the Changes file is for 0.06. >=20 > At http://search.cpan.org/~awa/Net-SSH2/, it says, "This Release > Net-SSH2-0.07" with a date of "11 Feb 2006", but you say in your mail, > "changes will be in 0.07", which sounds like it's not released yet. >=20 > Can you please clarify all this? Thanks. I have no idea who AWA is but that version isn't official or supported by a= ny=20 means. =A0I'm the original author and current maintainer of Net::SSH2 and I= 've=20 registered the namespace (see http://search.cpan.org/~dbrobins/). I've emailed aw...@cp... asking that he remove his Net::SSH2 module but th= e=20 mail bounced; I'll see what the CPAN maintainers can do about it. The current released version is 0.06. I have 0.07 ready to release shortly which is why I will say "changes will = be=20 in 0.07" in reply to various fixes in rt.cpan.org; it means I've made and=20 verified the change locally. =2D-=20 Dave Isa. 40:31 |
From: Rui V. F. M. <rui...@te...> - 2006-03-16 17:26:55
|
Hi Brian. Thanks a lot for helping. I have tried the things tou said, but I couldn't solve my problem: =20 # perl -MConfig -e 'print $Config{ccflags}."\n";' -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -I/usr/include/gdbm =20 (What do I do with this??) =20 =20 =20 # ldd Net-SSH2-0.06/blib/arch/auto/Net/SSH2/SSH2.so libssh2.so =3D> not found libc.so.6 =3D> /lib64/libc.so.6 (0x00002aaaaabdf000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) =20 =20 # file Net-SSH2-0.06/blib/arch/auto/Net/SSH2/SSH2.so Net-SSH2-0.06/blib/arch/auto/Net/SSH2/SSH2.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped (All the other files - /lib64/libc.so.6, /lib64/ld-linux-x86-64.so.2 - show the same information) =20 =20 =20 =20 Ok, now I know the error is this!!! (libssh2.so =3D> not found). But I didn't notice ant error while compiling libssh2! =20 =20 =20 =20 # ldd libssh2-0.12/src/libssh2.so libssl.so.5 =3D> /lib64/libssl.so.5 (0x00002aaaaabd8000) libcrypto.so.5 =3D> /lib64/libcrypto.so.5 (0x00002aaaaad13000) libgssapi_krb5.so.2 =3D> /usr/lib64/libgssapi_krb5.so.2 (0x00002aaaaaf3f000) libkrb5.so.3 =3D> /usr/lib64/libkrb5.so.3 (0x00002aaaab057000) libcom_err.so.2 =3D> /lib64/libcom_err.so.2 (0x00002aaaab1cb000) libk5crypto.so.3 =3D> /usr/lib64/libk5crypto.so.3 (0x00002aaaab2cd000) libresolv.so.2 =3D> /lib64/libresolv.so.2 (0x00002aaaab3f1000) libdl.so.2 =3D> /lib64/libdl.so.2 (0x00002aaaab506000) libz.so.1 =3D> /usr/lib64/libz.so.1 (0x00002aaaab60a000) libm.so.6 =3D> /lib64/libm.so.6 (0x00002aaaab71f000) libc.so.6 =3D> /lib64/libc.so.6 (0x00002aaaab8a4000) libkrb5support.so.0 =3D> /usr/lib64/libkrb5support.so.0 (0x00002aaaabadb000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) =20 # file libssh2-0.12/src/libssh2.so libssh2-0.12/src/libssh2.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped =20 =20 =20 Instalation of libssh2-0.12: =20 # ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for socket in -lsocket... no checking for ceil in -lm... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ANSI C... (cached) none needed checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for ranlib... ranlib checking whether byte ordering is bigendian... no checking for pkg-config... /usr/bin/pkg-config checking for OpenSSL... Using paths from pkg-config checking for libz... Found in /usr/local/include /usr/local/lib checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking sys/uio.h usability... yes checking sys/uio.h presence... yes checking for sys/uio.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking for poll... yes checking for gettimeofday... yes checking for select... yes checking for an ANSI C-conforming const... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating include/libssh2_config.h config.status: include/libssh2_config.h is unchanged =20 =20 # make all install make[1]: Entering directory `/home/config/Modulos_Perl/Net-SSH2/libssh2-0.12/src' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/config/Modulos_Perl/Net-SSH2/libssh2-0.12/src' gcc -o ssh2_sample.o ssh2_sample.c -c -g -O2 -I/usr/include -I/usr/local/include -Iinclude/ -Wall -g gcc -o ssh2_sample ssh2_sample.o -lssh2 -Lsrc/ ./mkinstalldirs /usr/local/include ./mkinstalldirs /usr/local/lib make[1]: Entering directory `/home/config/Modulos_Perl/Net-SSH2/libssh2-0.12/src' /usr/bin/install -c libssh2.so /usr/local/lib make[1]: Leaving directory `/home/config/Modulos_Perl/Net-SSH2/libssh2-0.12/src' /usr/bin/install -c -m 644 include/libssh2.h /usr/local/include/ /usr/bin/install -c -m 644 include/libssh2_sftp.h /usr/local/include/ /usr/bin/install -c -m 644 include/libssh2_publickey.h /usr/local/include/ =20 =20 Gor me, it seems that libssh2 is installed. But if I do this again: =20 # ldd Net-SSH2-0.06/blib/arch/auto/Net/SSH2/SSH2.so libssh2.so =3D> not found libc.so.6 =3D> /lib64/libc.so.6 (0x00002aaaaabdf000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) =20 =20 What can I do to install Net::SSH2? I really need this module for some scripts I'm creating, can anyone show me what I might try? I really don't know how to make this work... =20 Thanks! Rui |
From: Enrique de A. S. <enr...@pc...> - 2006-03-16 16:09:36
|
Hi, But with this example it's only possible to get the standard output of the executed commands. Do you know how to get the standard error (separated from the stdout)? Thanks, Enrique. Rob Verduijn wrote: > Hi there, > > I asked the same kinda question and did get an answer from Bryan Bueter. > With his help I managed to come up with the following example: > > > ###########begin > #!/usr/bin/perl > > # use warnings and strict to force neat coding, > # and prevent bugs in the future > use warnings; > use strict; > > use Net::SSH2; > > # some variables > my $remotehost="10.9.8.7"; > my $remotefile="/etc/passwd"; > my $localfile="copyoffpasswd"; > # this is not smart , make sure your scripts can run as non-root > my $login="root"; > # this is not smart , plain text password, use a keypair > my $password="verysecretpasswordinplaintext"; > my $chan; > > # creating the ssh2 object > my $ssh2 = Net::SSH2->new(); > > # connecting and logging in to the machine > die "connect fail" unless ($ssh2->connect($remotehost)); > die "password fail" unless ($ssh2->auth_password($login,$password)); > > # using exec to execute a command > $chan=$ssh2->channel(); > $chan->exec('uname -a'); > print "EXEC : $_" while <$chan>; > > # don't forget to close since you can do only 1 exec > $chan->close; > > # this is a get example, I think you can figure out the put version > $ssh2->scp_get($remotefile,$localfile); > > # writing to a channel > # a new channel, remember the last one is closed > $chan=$ssh2->channel(); > $chan->shell(); > print $chan "uptime\n"; > print $chan "who\n"; > # reading from a channel > print "SHELL: $_" while <$chan>; # lets see what the output is > > # clean up afterwards > $chan->close; > ########end > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > > |
From: <smi...@em...> - 2006-03-16 15:28:05
|
I'm confused as to what the current version is. When you go to http://search.cpan.org/~awa/Net-SSH2/lib/Net/SSH2.pm, it says "Module Version: 0.06", but also has a link "Download: AWA/Net-SSH2-0.07.tar.gz". When I downloadNet-SSH2-0.07.tar.gz and unpack it, the latest entry in the Changes file is for 0.06. At http://search.cpan.org/~awa/Net-SSH2/, it says, "This Release Net-SSH2-0.07" with a date of "11 Feb 2006", but you say in your mail, "changes will be in 0.07", which sounds like it's not released yet. Can you please clarify all this? Thanks. Roy Smith <smi...@em...> Staff SW Engineer EMC / Smarts +1 914 580 3427 > -----Original Message----- > From: ssh...@li... > [mailto:ssh...@li...] On > Behalf Of David Robins > Sent: Wednesday, March 15, 2006 11:21 PM > To: ssh...@li... > Subject: Re: [Ssh-sftp-perl-users] SSH2 example on CPAN wrong? > > On Wednesday March 15, 2006 07:49, smi...@em... wrote: > > I'm looking at the example (Synopsis) at: > > > > > http://search.cpan.org/~dbrobins/Net-SSH2-0.06/lib/Net/SSH2.pm > #SYNOPSIS > > > > and it doesn't make sense. Can that code possibly be > correct? There's no > > connect() call. I also don't understand how the sftp object gets > > asssociated with the channel which was created. > > It's not a full program, but still you're right, it needs to > be updated. I'll update it now; changes will be in 0.07. > > Thanks, > > -- > Dave > Isa. 40:31 > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking > scripting language > that extends applications into web and mobile media. Attend > the live webcast > and join the prime developer group breaking into this new > coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720& > dat=121642 > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > |
From: Rob V. <rob...@br...> - 2006-03-16 07:51:19
|
Hi there, I asked the same kinda question and did get an answer from Bryan Bueter. With his help I managed to come up with the following example: ###########begin #!/usr/bin/perl # use warnings and strict to force neat coding, # and prevent bugs in the future use warnings; use strict; use Net::SSH2; # some variables my $remotehost="10.9.8.7"; my $remotefile="/etc/passwd"; my $localfile="copyoffpasswd"; # this is not smart , make sure your scripts can run as non-root my $login="root"; # this is not smart , plain text password, use a keypair my $password="verysecretpasswordinplaintext"; my $chan; # creating the ssh2 object my $ssh2 = Net::SSH2->new(); # connecting and logging in to the machine die "connect fail" unless ($ssh2->connect($remotehost)); die "password fail" unless ($ssh2->auth_password($login,$password)); # using exec to execute a command $chan=$ssh2->channel(); $chan->exec('uname -a'); print "EXEC : $_" while <$chan>; # don't forget to close since you can do only 1 exec $chan->close; # this is a get example, I think you can figure out the put version $ssh2->scp_get($remotefile,$localfile); # writing to a channel # a new channel, remember the last one is closed $chan=$ssh2->channel(); $chan->shell(); print $chan "uptime\n"; print $chan "who\n"; # reading from a channel print "SHELL: $_" while <$chan>; # lets see what the output is # clean up afterwards $chan->close; ########end |
From: Michael G. <mic...@bl...> - 2006-03-16 04:32:12
|
Hello, I have a perl script the runs like a daemon process, once started it does not exit unless sent a kill signal. It is used to monitor a log file. In this script I have a sub with the following code: --snip-- my $ssh2 = Net::SSH2->new; &contact_error("Unable to connect to server") unless $ssh2->connect($settings->get('filter.host')); &contact_error("Unable to authenticate") unless $ssh2->auth_password($settings->get('filter.user'),$settings->get('filter.pass')); my $chan = $ssh2->channel; $chan->exec('sudo run some command') or $rtn=1; my $chan_rtn = $chan->exit_status; &dlogging("$chan_rtn"); $chan->close(); $ssh2->disconnect('byebye'); --snip-- Now this all work fine except a netstat shows the connection still open and it is stuck in a CLOSE_WAIT state. It will never exit this stat, untill I kill the process and then they will slowly turn to a LASK_ACK stat and then the connection will be removed. What am I doing wrong that this connection is being left open ? Thanks Michael Gale |
From: David R. <dbr...@cp...> - 2006-03-16 03:33:50
|
On Wednesday March 15, 2006 07:49, smi...@em... wrote: > I'm looking at the example (Synopsis) at: > > http://search.cpan.org/~dbrobins/Net-SSH2-0.06/lib/Net/SSH2.pm#SYNOPSIS > > and it doesn't make sense. Can that code possibly be correct? There's no > connect() call. I also don't understand how the sftp object gets > asssociated with the channel which was created. It's not a full program, but still you're right, it needs to be updated. I'll update it now; changes will be in 0.07. Thanks, -- Dave Isa. 40:31 |
From: David R. <dbr...@cp...> - 2006-03-16 03:33:03
|
On Wednesday March 15, 2006 04:01, Rob Verduijn wrote: > Hi all, > > I've noticed the bug for files bigger than 25k and that > these still are present in the 0.07 version. 0.07 hasn't been released yet. > I've also build rpms for Net::SSH2 and libSSH2 which I tested on Suse > 10.0 and Suse 9.1, if anybody is interested drop me an email. Great, I'm sure it will be appreciated. -- Dave Isa. 40:31 |
From: <smi...@em...> - 2006-03-15 15:50:53
|
I'm looking at the example (Synopsis) at: http://search.cpan.org/~dbrobins/Net-SSH2-0.06/lib/Net/SSH2.pm#SYNOPSIS and it doesn't make sense. Can that code possibly be correct? There's no connect() call. I also don't understand how the sftp object gets asssociated with the channel which was created. Roy Smith <smi...@em...> Staff SW Engineer EMC / Smarts +1 914 580 3427 |
From: Curt S. <csh...@gm...> - 2006-03-15 15:40:59
|
I have to write a process that gets 1 or more files from a remote source, when the exact file name will not be known. I think I have the right logic but it does not appear to be working like I expect. #############begin code################# #!/usr/bin/perl use strict; use Net::SFTP; use Net::SFTP::Util; use Net::SFTP::Constants; my $host = "x.x.x.x"; my $user = "username"; my $pass = "password"; my $cmd = "get"; my $remotedir = "/pub"; my $sftp = Net::SFTP->new("$host",user=>"$user",password=>"$pass",protocol=>"2",debug=> "1"); my @files = $sftp->ls("$remotedir"); foreach (@files){ $sftp->get($_); print "recieving $_...\n"; } print "Complete!\n"; ###############end code####################### What I am getting for each loop in the debug is the following: linuxbox: sftp: Sent message T:17 I:30 linuxbox: sftp: Received stat reply T:101 I:30 Couldn't stat remote file: No such file or directory at ./sftptest line 19 recieving HASH(0x98d9440)... Of course the HASH is different for each loop Line 19 is $sftp->get($_); Is the receipt supposed to be a HASH value or am I missing something. If it is how do I get the filename from that? Thanks Curt |
From: Enrique de A. S. <enr...@pc...> - 2006-03-15 15:33:28
|
Hi, I'm searching examples about how to use read and write methods of=20 Net::SSH2::Channel object but I haven't found anyone. Does anybody have=20 anyone? Thanks in advance, Enrique. --=20 Enrique de Andr=E9s Saiz Unidad de Bioinform=E1tica Parque Cient=EDfico de Madrid Ctra. de Colmenar, Km. 15 Campus Universidad Aut=F3noma de Madrid, Cantoblanco - Pabell=F3n C 28049 Madrid Phone: +34 91 497 3448 Fax: +34 91 497 3471 E-mail: enr...@pc... |
From: Enrique de A. S. <enr...@pc...> - 2006-03-15 13:55:26
|
You can try this code: my $ssh2 = Net::SSH2->new(); eval { $ssh2->connect($host) }; die "Cannot connect to host.\n" if ($@); print "Connected"; # etc, etc, etc... Regards, Enrique. Hardik Vyas wrote: > I am having issues with the SSH2 connect method. When the $WEB_SERVER > is valid, it works fine and connects but when the $WEB_SERVER is invalid > that perl script hangs at the connect method and "Can not connect" is > never printed (Note: $WEB_SERVER is a parameter that is passed via the > command line). Has anyone had similar problems and know how I can fix > this issue? > > my $conn = Net::SSH2->new(); > > if($conn->connect("$WEB_SERVER")) > > { > > print "Connected"; > > } > > else > > { > > print "Can not connect"; > > } > > > > > ------------------------------------------------------- This SF.Net > email is sponsored by xPML, a groundbreaking scripting language that > extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ Ssh-sftp-perl-users > mailing list Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: Rob V. <rob...@br...> - 2006-03-15 12:01:05
|
Hi all, I've noticed the bug for files bigger than 25k and that these still are present in the 0.07 version. I've made two patch files for these according to the fixes mentioned by Rutger Ovidius. These are almost identical to the ones from Rutger minus a couple lines that were already applied to the code. see the attachment. Regards Rob p.s. I've also build rpms for Net::SSH2 and libSSH2 which I tested on Suse 10.0 and Suse 9.1, if anybody is interested drop me an email. Op do, 16-02-2006 te 20:32 -0800, schreef David Robins: > On Thursday February 16, 2006 11:27, Rutger Ovidius wrote: > > Saturday, February 11, 2006, 8:18:21 AM, you wrote: > > > > RO> But scp_get does not work on files > 25k or so. For a 2k file, it works, but > > RO> larger files receive a segmentation fault. > > > > RO> scp_put just creates a 0 byte file on the remote system but doesn't transfer the contents. > > > > I found the scp_get problem; the pv_buffer was being incremented and > > then accessed at an incorrect position. (Requires a recompile of SSH2.xs). > > Fixed for 0.07, thanks. > > > The scp_put problem was patched by by R. Corbridge. stat[2] was being > > used rather than stat[7] in SSH2.pm. > > I already picked that up, it will also be in 0.07. > > Thanks, > |
From: <smi...@em...> - 2006-03-15 00:47:16
|
I'm trying to use Net::ssh2 to connect to a Cisco router. When I run the script below, I get: krypton:test$ ./test.pl KEX = diffie-hellman-group1-sha1 HOSTKEY = ssh-rsa CRYPT_CS = aes256-cbc CRYPT_SC = aes256-cbc MAC_CS = hmac-sha1 MAC_SC = hmac-sha1 COMP_CS = none COMP_SC = none auth_list ==> password auth_ok ==> 4 in _read() So, it looks like I'm getting connected and authenticated, but then there's nothing to read from the channel. If I connect to the router with the command-line ssh, I get: krypton:test$ ssh cisco@10.9.6.250 cisco@10.9.6.250's password: Center of the galaxy qa> What I was expecting when I called _read() was that I would get back the "Center of the galaxy" banner, and the "qa>" prompt. Instead I get nothing. What am I doing wrong? ---------------------------------------------- #!/usr/bin/env perl use Net::SSH2; use diagnostics; my $ssh2 = Net::SSH2->new(); $ssh2->connect('10.9.6.250'); for $method ('KEX', 'HOSTKEY', 'CRYPT_CS', 'CRYPT_SC', 'MAC_CS', 'MAC_SC', 'COMP_CS', 'COMP_SC') { $value = $ssh2->method($method); print "$method = $value\n"; } print "\n"; $alist = $ssh2->auth_list(); print "auth_list ==> $alist\n"; our $err = $ssh2->auth_password('cisco', 'XXXXX'); print "auth_ok ==> ", $ssh2->auth_ok(), "\n"; $chan = $ssh2->channel() or die "channel() failed"; $chan->pty("ansi") or die "pty() failed"; $chan->shell() or die "shell() failed"; _read ($chan); sub _read { print "in _read()\n"; my $handle = shift; while (my $line = <$handle>) { chomp $line; $line =~ s/:.*$//; print "found user '$line'\n"; } } Roy Smith <smi...@em...> Staff SW Engineer EMC / Smarts +1 914 580 3427 |
From: Bryan B. <br...@bu...> - 2006-03-14 11:28:58
|
> > > I'm installing Net-SSH2-0.06. > > I have installed (by this order), the following modules: > - openssl-0.9.8a > - zlib-1.2.3 > - libssh2-0.12 > - TermReadKey-2.30 > > Did you build these or download binaries? If your running perl x86_64, then you need to build these from source using the same cflags your build of perl uses. That appears to be at least: CFLAGS='-fexceptions -m64 -mtune=nocona'. See full cflags: perl -MConfig -e 'print $Config{ccflags}."\n";' > > > > Now I'm installing Net-SSH2-0.06: > > # perl Makefile.PL > Net::SSH2: using library -L/usr/local/lib -lssh2 and include path - > I/usr/local/include. > Checking if your kit is complete... > Looks good > Writing Makefile for Net::SSH2 > > > # make > cp lib/Net/SSH2/File.pm blib/lib/Net/SSH2/File.pm > cp lib/Net/SSH2/Dir.pm blib/lib/Net/SSH2/Dir.pm > cp lib/Net/SSH2/SFTP.pm blib/lib/Net/SSH2/SFTP.pm > cp lib/Net/SSH2/Listener.pm blib/lib/Net/SSH2/Listener.pm > cp lib/Net/SSH2/Channel.pm blib/lib/Net/SSH2/Channel.pm > cp lib/Net/SSH2.pm blib/lib/Net/SSH2.pm > AutoSplitting blib/lib/Net/SSH2.pm (blib/lib/auto/Net/SSH2) > /usr/bin/perl /usr/lib/perl5/5.8.6/ExtUtils/xsubpp - > typemap /usr/lib/perl5/5.8.6/ExtUtils/typemap -typemap typemap > SSH2.xs > SSH2.xsc && mv SSH2.xsc SSH2.c > gcc -c -I/usr/local/include -I. -D_REENTRANT -D_GNU_SOURCE - > DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include - > D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g - > pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m64 -mtune=nocona - > DVERSION=\"0.06\" -DXS_VERSION=\"0.06\" -fPIC "- > I/usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/CORE" SSH2.c > SSH2.xs: In function XS_Net__SSH2__PublicKey_add: > SSH2.xs:1729: warning: pointer targets in passing argument 2 of > libssh2_publickey_add_ex differ in signedness > SSH2.xs:1729: warning: pointer targets in passing argument 4 of > libssh2_publickey_add_ex differ in signedness > SSH2.xs: In function XS_Net__SSH2__PublicKey_remove: > SSH2.xs:1743: warning: pointer targets in passing argument 2 of > libssh2_publickey_remove_ex differ in signedness > SSH2.xs:1743: warning: pointer targets in passing argument 4 of > libssh2_publickey_remove_ex differ in signedness > Running Mkbootstrap for Net::SSH2 () > chmod 644 SSH2.bs > rm -f blib/arch/auto/Net/SSH2/SSH2.so > gcc -shared SSH2.o -o blib/arch/auto/Net/SSH2/SSH2.so - > L/usr/local/lib -lssh2 > chmod 755 blib/arch/auto/Net/SSH2/SSH2.so > cp SSH2.bs blib/arch/auto/Net/SSH2/SSH2.bs > chmod 644 blib/arch/auto/Net/SSH2/SSH2.bs > Manifying blib/man3/Net::SSH2::File.3pm > Manifying blib/man3/Net::SSH2::Dir.3pm > Manifying blib/man3/Net::SSH2::SFTP.3pm > Manifying blib/man3/Net::SSH2::Listener.3pm > Manifying blib/man3/Net::SSH2::Channel.3pm > Manifying blib/man3/Net::SSH2.3pm > > > # make test > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "- > e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/Net-SSH2....# Failed test (t/Net-SSH2.t at line 19) > > # Tried to use 'Net::SSH2'. > # Error: Can't load '/home/config/Modulos_Perl/Net-SSH2/Net-SSH2- > > 0.06/blib/arch/auto/Net/SSH2/SSH2.so' for module Net::SSH2: > libssh2.so: cannot open shared object file: No such file or directory > at /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/DynaLoader.pm line > 230. > This is your problem, do an ldd on 0.06/blib/arch/auto/Net/SSH2/SSH2.so, then check all the pre-requisite libraries with file and make sure they are the same type as "file 0.06/blib/arch/auto/Net/SSH2/SSH2.so". Hope that helps. Bryan http://sourceforge.net/projects/rover |
From: Rui V. F. M. <rui...@te...> - 2006-03-14 11:04:08
|
=20 I'm installing Net-SSH2-0.06. I have installed (by this order), the following modules: - openssl-0.9.8a - zlib-1.2.3 - libssh2-0.12 - TermReadKey-2.30 Now I'm installing Net-SSH2-0.06: # perl Makefile.PL Net::SSH2: using library -L/usr/local/lib -lssh2 and include path - I/usr/local/include. Checking if your kit is complete... Looks good Writing Makefile for Net::SSH2 # make cp lib/Net/SSH2/File.pm blib/lib/Net/SSH2/File.pm cp lib/Net/SSH2/Dir.pm blib/lib/Net/SSH2/Dir.pm cp lib/Net/SSH2/SFTP.pm blib/lib/Net/SSH2/SFTP.pm cp lib/Net/SSH2/Listener.pm blib/lib/Net/SSH2/Listener.pm cp lib/Net/SSH2/Channel.pm blib/lib/Net/SSH2/Channel.pm cp lib/Net/SSH2.pm blib/lib/Net/SSH2.pm AutoSplitting blib/lib/Net/SSH2.pm (blib/lib/auto/Net/SSH2) /usr/bin/perl /usr/lib/perl5/5.8.6/ExtUtils/xsubpp - typemap /usr/lib/perl5/5.8.6/ExtUtils/typemap -typemap typemap=20 SSH2.xs > SSH2.xsc && mv SSH2.xsc SSH2.c gcc -c -I/usr/local/include -I. -D_REENTRANT -D_GNU_SOURCE - DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -I/usr/include/gdbm -O2 -g - pipe -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -m64 -mtune=3Dnocona - DVERSION=3D\"0.06\" -DXS_VERSION=3D\"0.06\" -fPIC "- I/usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/CORE" SSH2.c SSH2.xs: In function XS_Net__SSH2__PublicKey_add: SSH2.xs:1729: warning: pointer targets in passing argument 2 of=20 libssh2_publickey_add_ex differ in signedness SSH2.xs:1729: warning: pointer targets in passing argument 4 of=20 libssh2_publickey_add_ex differ in signedness SSH2.xs: In function XS_Net__SSH2__PublicKey_remove: SSH2.xs:1743: warning: pointer targets in passing argument 2 of=20 libssh2_publickey_remove_ex differ in signedness SSH2.xs:1743: warning: pointer targets in passing argument 4 of=20 libssh2_publickey_remove_ex differ in signedness Running Mkbootstrap for Net::SSH2 () chmod 644 SSH2.bs rm -f blib/arch/auto/Net/SSH2/SSH2.so gcc -shared SSH2.o -o blib/arch/auto/Net/SSH2/SSH2.so - L/usr/local/lib -lssh2 chmod 755 blib/arch/auto/Net/SSH2/SSH2.so cp SSH2.bs blib/arch/auto/Net/SSH2/SSH2.bs chmod 644 blib/arch/auto/Net/SSH2/SSH2.bs Manifying blib/man3/Net::SSH2::File.3pm Manifying blib/man3/Net::SSH2::Dir.3pm Manifying blib/man3/Net::SSH2::SFTP.3pm Manifying blib/man3/Net::SSH2::Listener.3pm Manifying blib/man3/Net::SSH2::Channel.3pm Manifying blib/man3/Net::SSH2.3pm # make test PERL_DL_NONLAZY=3D1 /usr/bin/perl "-MExtUtils::Command::MM" "- e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/Net-SSH2....# Failed test (t/Net-SSH2.t at line 19) # Tried to use 'Net::SSH2'. # Error: Can't load '/home/config/Modulos_Perl/Net-SSH2/Net-SSH2- 0.06/blib/arch/auto/Net/SSH2/SSH2.so' for module Net::SSH2:=20 libssh2.so: cannot open shared object file: No such file or directory=20 at /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/DynaLoader.pm line=20 230. # at (eval 1) line 2 # Compilation failed in require at (eval 1) line 2. t/Net-SSH2....NOK 1&Net::SSH2::constant not defined at t/Net-SSH2.t=20 line 22 # Looks like you planned 72 tests but only ran 1. # Looks like your test died just after 1. t/Net-SSH2....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-72 Failed 72/72 tests, 0.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed =20 t/Net-SSH2.t 255 65280 72 143 198.61% 1-72 Failed 1/1 test scripts, 0.00% okay. 72/72 subtests failed, 0.00% okay. make: *** [test_dynamic] Error 2 =20 =20 =20 =20 Does anyone know why is this error happening? How may I solve it? Thanks! Running in: Linux Fedora 4 x86_64 Perl v5.8.6 built for x86_64-linux-thread-multi. Net::SSH::Perl-1.29 =20 |
From: Rui V. F. M. <rui...@te...> - 2006-03-13 18:03:57
|
Sorry, this test if because I've tried to post a message many times and I always receive an e-mail with the message: =20 "Message has implicit destination" =20 |
From: Hardik V. <har...@ho...> - 2006-03-09 16:33:20
|
<html><div style='background-color:'><P><FONT size=2>my $fileo = $sf->open("$SOURCE_DIR/$fname");</P> <DIV> <DIV class=RTE> <P>if(defined($fileo))</P> <P>{</P> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <P>print "Start transferring file $fname from $SOURCE_DIR.\n";</P> <P>my %fstat = $sf->stat("$SOURCE_DIR/$fname");</P> <P>my $fsize = $fstat{size};</P> <P>my $fbuf;</P> <P>my $readSize = $fileo->read($fbuf, $fsize);</P> <P>open(DEST, ">$fname");</P> <P>print "File\n\n", $fbuf, "\n";</P> <P>print DEST $fbuf;</P> <P>close(DEST);</P> <P></P> <P>$del_stat = $sf->unlink("$SOURCE_DIR/$fname");</P> <P>if ($del_stat ne 1)</P> <P>{</P> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <P>print "Error deleting file $fname.\n";</P></BLOCKQUOTE> <P>} </P></BLOCKQUOTE> <P>}</P> <P>I am having problems transferring a large file (~244KB) with the code above. Note: $sf is a SSH2 Secure FTP object. This code works for transferring smaller size files but does not for larger ones. Does anyone know how I can transfer larger files using ssh2?</FONT></P></DIV></DIV></div></html> |
From: Philippe L. <phi...@as...> - 2006-03-08 10:33:24
|
Hi, I am much frustrated because near the success.. :) I am trying to run ssh commands from a win 2k host to an Unix ssh server, using Net::SSH::W32Perl (0.06) from active PERL. The connection and the authentication are speed, but after the command ssh->cmd, the ssh seems frozen, and the PC's CPU is growing up to 100%. Then, nothing happens (during hours...). My (simple) script is below : #================ SCRIPT BEGINNING ========== use Net::SSH::W32Perl; use strict; my $host="supervision"; my $user = "netadmin"; my $pass="XXXXX"; my %ssh_arguments = (debug=>1); my $ssh = new Net::SSH::W32Perl($host, %ssh_arguments ); print "Step 1 \n\n"; $ssh->login($user,$pass); print "Step 2 \n\n"; my ($out, $err, $exit) = $ssh->cmd('hostname ; exit '); print "Step 3 \n\n"; print "Output = $out \n","Error = $err \n","Exit = $exit \n"; #================ SCRIPT END ========== My output log is : #================ LOG BEGINNING ========== nanu22244: Reading configuration data /.ssh/config nanu22244: Reading configuration data /etc/ssh_config nanu22244: Connecting to supervision, port 22. nanu22244: Socket created, turning on blocking... nanu22244: Remote protocol version 2.0, remote software version Sun_SSH_1.0 Step 1 nanu22244: Net::SSH::Perl Version 1.29, protocol version 2.0. nanu22244: No compat match: Sun_SSH_1.0. nanu22244: Connection established. nanu22244: Sent key-exchange init (KEXINIT), wait response. nanu22244: Algorithms, c->s: 3des-cbc hmac-sha1 none nanu22244: Algorithms, s->c: 3des-cbc hmac-sha1 none nanu22244: Entering Diffie-Hellman Group 1 key exchange. nanu22244: Sent DH public key, waiting for reply. nanu22244: Received host key, type 'ssh-dss'. nanu22244: Host 'supervision' is known and matches the host key. nanu22244: Computing shared secret key. nanu22244: Verifying server signature. nanu22244: Waiting for NEWKEYS message. nanu22244: Enabling incoming encryption/MAC/compression. nanu22244: Send NEWKEYS, enable outgoing encryption/MAC/compression. nanu22244: Sending request for user-authentication service. nanu22244: Service accepted: ssh-userauth. nanu22244: Trying empty user-authentication request. Step 2 nanu22244: Authentication methods that can continue: publickey,password. nanu22244: Next method to try is publickey. nanu22244: Next method to try is password. nanu22244: Trying password authentication. nanu22244: Login completed, opening dummy shell channel. nanu22244: channel 0: new [client-session] nanu22244: Requesting channel_open for channel 0. nanu22244: channel 0: open confirm rwindow 0 rmax 16384 nanu22244: Got channel open confirmation, requesting shell. nanu22244: Requesting service shell on channel 0. nanu22244: channel 1: new [client-session] nanu22244: Requesting channel_open for channel 1. nanu22244: Entering interactive session. nanu22244: Sending command: hostname ; exit nanu22244: Requesting service exec on channel 1. nanu22244: channel 1: open confirm rwindow 0 rmax 16384 nanu22244: input_channel_request: rtype exit-status reply 0 #================ LOG END ========== Each time, the ssh is blocked at the same step : " input_channel_request: rtype exit-status reply 0". I have tried with an other ssh server, but the behavior is the same. I think I have installed all the modules required. Many thanks & kind regards Philippe |
From: Bryan B. <br...@bu...> - 2006-03-06 14:14:26
|
> Hi all, > > I have written a simple script to ssh to a remote box using > Net::SSH::Perl. It > works well enough when I supply the correct user name and password. > > However, if I supply a bad user name or password, the script dies with the > following error: > > Received disconnect message: Too many authentication failures for > bad_user > at /usr/local/lib/perl5/site_perl/5.8.0/Net/SSH/Perl/AuthMgr.pm line > 142 > > This behavior is undesired. I do not want the script to die. I want to be > able to test to see if authorization was successful and handle this error > myself, instead of dying. Pretty easy, just trap the actuall authentication in an eval block. > Here is a stripped down version of my script: > ------------------------------------------------------------------------ -------- > #!/usr/bin/perl > use strict; > use Net::SSH::Perl; > use Net::SSH::Perl::Constants qw( :agent ); > > my ($ip,$user,$passwd) = @ARGV; > > if (!$passwd) { > print "USAGE: ssh_test_login.pl [device ip] [user] [password]\n"; exit; > } > > my $ssh = Net::SSH::Perl->new($ip, protocol => 2, > debug => 1, > PreferredAuthentications => > 'password', > PasswordAuthentication => 'yes', PubkeyAuthentication => 'no', RSAAuthentication => 'no' > ); > > $ssh->register_handler( > SSH_AGENT_FAILURE, > sub { > my($channel, $buffer) = @_; > print "I received this: ", > $buffer->bytes; > } > ); > > > print "==================== login attempt ======================\n"; $ssh->login($user, $passwd); Just change this to: eval { $ssh->login($user, $pass); }; if ( $@ ) { # print error message, move to next host } else { # actually do something } Hope that helps. Bryan http://sourceforge.net/projects/rover |
From: Hardik V. <har...@ho...> - 2006-03-03 23:04:25
|
<html><div style='background-color:'><DIV class=RTE><FONT size=2> <P>I am having issues with the SSH2 connect method. When the $WEB_SERVER is valid, it works fine and connects but when the $WEB_SERVER is invalid that perl script hangs at the connect method and "Can not connect" is never printed (Note: $WEB_SERVER is a parameter that is passed via the command line). Has anyone had similar problems and know how I can fix this issue?</P> <P>my $conn = Net::SSH2->new();</P> <P>if($conn->connect("$WEB_SERVER"))</P> <P>{</P> <P> print "Connected";</P> <P>}</P> <P>else</P> <P>{</P> <P> print "Can not connect";</P> <P>}</P> <P></FONT><BR> </P></DIV></div></html> |