ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 15)
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: Heiko J. <ja...@hb...> - 2007-10-30 13:14:32
|
Hi David, hi folks. Just tried to install Net::SSH2 (0.10 from CPAN) on my Solaris 10 / SPARC 64 box with libssh2-0.17 installed. Compiling went fine, "make test" not. Found http://rt.cpan.org/Ticket/Display.html?id=28722 and applied the patch from Roland Lammel which seemed to make the test suite succeed. But then I saw that numerous tests weren't executed. I then edited the test script and provided host, username and password to activate theother tests. That gave me: ~/.cpan/build/Net-SSH2-0.10> make test PERL_DL_NONLAZY=1 /digibib/tools/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/Net-SSH2....ok 1/72 # Failed test 'SFTP session isa Net::SSH2::SFTP' t/Net-SSH2....NOK 37/72# at t/Net-SSH2.t line 113. # SFTP session isn't defined Can't call method "session" on an undefined value at t/Net-SSH2.t line 114. # Looks like you planned 72 tests but only ran 37. # Looks like you failed 1 test of 37 run. # Looks like your test died just after 37. t/Net-SSH2....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 37-72 Failed 36/72 tests, 50.00% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/Net-SSH2.t 255 65280 72 71 37-72 Failed 1/1 test scripts. 36/72 subtests failed. Files=1, Tests=72, 1 wallclock secs ( 0.34 cusr + 0.04 csys = 0.38 CPU) Failed 1/1 test programs. 36/72 subtests failed. make: *** [test_dynamic] Error 255 The scalar $sftp (initialized as $ssh2->sftp()) in line 112 is actually undefined. The simple sftp examples provided by libssh2-0.17 do work with the same credentials, so I suppose this is a problem related to the refactoring of libssh2 after the release of Net::SSH2 0.10 with Net::SSH2 no longer working corretly (at least concerning SFTP). Would be great if someone could analyse and fix this ;-) Regards Heiko |
From: Radu H. <xr...@ya...> - 2007-10-18 23:13:29
|
=0AI'm in touch with the developer of the module (David Robins) and he said= he'll take a look at it at some point ... I'm trying to assist him with as= much info as I can. =0A=0AGoing back to the problem a=0A=0A$ssh2->debug(1)= ;=0A=0Aseems to indicate that things are going wrong as soon as an 'incompl= ete' block=0Ais read, i.e. 8192 is expected and less than that is actually = read. =0A=0AI have moved on to find a solution to my file transfer problem = since I really needed to move on but the person that collaborates with me s= uspects the problem to be in libssl2. we're using version 0.17 but going ba= ck to 0.14 (rebuilding the lib and the perl module with that version of the= lib) seems to work. the break happens after the transition to libssl2 from= 0.14 to 0.15, so it might be the case that the perl module may need a face= lift to keep up with times...=0A=0AThanks ,=0A=0ARadu=0A=0A=0A----- Origina= l Message ----=0AFrom: Diego Oberlin <d.o...@gm...>=0ATo: Radu Hando= rean <xr...@ya...>=0ASent: Thursday, October 18, 2007 6:21:23 AM=0ASu= bject: Re: [Ssh-sftp-perl-users] scp_get problems=0A=0A=0A-----BEGIN PGP SI= GNED MESSAGE-----=0AHash: SHA1=0A=0ARadu Handorean wrote:=0A> <!-- DIV {mar= gin:0px;} --> Hello,=0A>=0A> The code snippet I have a question about is th= is one: my $ssh2 =3D=0A> Net::SSH2->new(); $ssh2->connect($sourceServer) or= die ("Unable to=0A> connect"); $ssh2->auth_keyboard('user', 'password') or= die ("Unable=0A> to login"); $ssh2->scp_get($sourceFileName); $ssh2->disco= nnect(); I=0A> am using Net::SSH2. The problem is that the scp_get call han= gs=0A> indefinitely. I am trying to download a 15MB file. It seems it gets= =0A> stuck after about 12-13MB. Interesting is that if I repeat the=0A> ex= periment, it seems to stop at the same file size, for a while,=0A> then it = seems to stick to that new value for another while, and so=0A> on. Anyway, = it doesn't make any progress past that point (not even=0A> a crash with or = without an error message).=0A>=0A> I have the similar scp_put call that upl= oads that file and that=0A> upload works like a charm every time. Not a sin= gle problem. On the=0A> flip side, the download call I pasted did not work = even once. I'd=0A> appreciate some help to get past this problem, if anybod= y knows the=0A> way out.=0A>=0A> Thanks, Radu=0A>=0A> ____________________= ______________________________ Do You Yahoo!?=0A> Tired of spam? Yahoo! Mai= l has the best spam protection around=0A> http://mail.yahoo.com=0A>=0A>=0A = ----------------------------------------------------------------------=0A>= =0A>=0A>=0A ---------------------------------------------------------------= ----------=0A> This SF.net email is sponsored by: Splunk Inc. Still greppi= ng=0A> through log files to find problems? Stop. Now Search log events=0A>= and configuration files using AJAX and a browser. Download your=0A> FREE c= opy of Splunk now >> http://get.splunk.com/=0A>=0A>=0A --------------------= --------------------------------------------------=0A>=0A>=0A> ____________= ___________________________________ Ssh-sftp-perl-users=0A> mailing list Ss= h-s...@li...=0A> https://lists.sourceforge.net/l= ists/listinfo/ssh-sftp-perl-users=0A=0AHave you tried to debug? Try using N= et::SSH2 debug() method, to see=0Awhether it throws you any clue about wha= t's happening there.=0AOtherwise try to strace for more detailed informatio= n and send us the=0Aoutput.=0A=0ARegards,=0A=0ADiego Oberlin.=0A=0A=0A-----= BEGIN PGP SIGNATURE-----=0AVersion: GnuPG v1.4.6 (GNU/Linux)=0AComment: Usi= ng GnuPG with Mozilla - http://enigmail.mozdev.org=0A=0AiD8DBQFHF0/D2COt/e1= SGbwRAvL8AJ4mLgKqQOwa8ZhYSSutclo9WmCUVwCdETkE=0ABX8/heF7gzf3kmq026xM4EQ=3D= =0A=3DHOQ0=0A-----END PGP SIGNATURE-----=0A=0A=0A=0A=0A=0A=0A______________= ____________________________________=0ADo You Yahoo!?=0ATired of spam? Yah= oo! Mail has the best spam protection around =0Ahttp://mail.yahoo.com |
From: Radu H. <xr...@ya...> - 2007-10-17 19:42:43
|
Hello,=0A=0A=0A=0AThe code snippet I have a question about is this one:=0A= =0Amy $ssh2 =3D Net::SSH2->new();=0A$ssh2->connect($sourceServer) or die ("= Unable to connect"); =0A$ssh2->auth_keyboard('user', 'password') or die ("U= nable to login"); =0A$ssh2->scp_get($sourceFileName);=0A$ssh2->disconnect()= ;=0A=0A=0AI am using Net::SSH2. The problem is that the scp_get call hangs= =0Aindefinitely. I am trying to download a 15MB file. It seems it gets=0Ast= uck after about 12-13MB. Interesting is that if I repeat the=0Aexperiment, = it seems to stop at the same file size, for a while, then=0Ait seems to sti= ck to that new value for another while, and so on.=0AAnyway, it doesn't mak= e any progress past that point (not even a crash=0Awith or without an error= message). =0A=0A=0AI have the similar scp_put call that uploads that file = and that upload=0Aworks like a charm every time. Not a single problem. On t= he flip side,=0Athe download call I pasted did not work even once. I'd appr= eciate some=0Ahelp to get past this problem, if anybody knows the way out. = =0A=0A=0A=0AThanks,=0A=0ARadu=0A=0A=0A_____________________________________= _____________=0ADo You Yahoo!?=0ATired of spam? Yahoo! Mail has the best s= pam protection around =0Ahttp://mail.yahoo.com |
From: Langley, P. B [NTK] <Pau...@sp...> - 2007-10-12 19:41:19
|
Hi, I am using Net::SSh::Perl to connect to remote servers. I am able to login to these devices but the=20 session fails at the point when I send my commands. Is SSH-2.0-OpenSSH_3.5p1 not compatible=20 or do I need to tweak my setup? DATA LOG: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Reading configuration data /etc/ssh_config Connecting to xx.xx.xx.xx, port 22. Remote version string: SSH-2.0-OpenSSH_3.5p1 Remote protocol version 2.0, remote software version OpenSSH_3.5p1 Net::SSH::Perl Version 1.30, protocol version 2.0. No compat match: OpenSSH_3.5p1. Connection established. Sent key-exchange init (KEXINIT), wait response. Algorithms, c->s: 3des-cbc hmac-sha1 none Algorithms, s->c: 3des-cbc hmac-sha1 none Entering Diffie-Hellman Group 1 key exchange. Sent DH public key, waiting for reply. Received host key, type 'ssh-dss'. Host 'xx.xx.xx.xx' is known and matches the host key. Computing shared secret key. Verifying server signature. Waiting for NEWKEYS message. Enabling incoming encryption/MAC/compression. Send NEWKEYS, enable outgoing encryption/MAC/compression. Sending request for user-authentication service. Service accepted: ssh-userauth. Trying empty user-authentication request. Authentication methods that can continue: password. Next method to try is password. Trying password authentication. Login completed, opening dummy shell channel. channel 0: new [client-session] Requesting channel_open for channel 0. channel 0: open confirm rwindow 0 rmax 32768 Got channel open confirmation, requesting shell. Requesting service shell on channel 0. channel 1: new [client-session] Requesting channel_open for channel 1. Entering interactive session. Channel open failure: 1: reason 1: open failed channel 2: new [client-session] Requesting channel_open for channel 2. Entering interactive session. Channel open failure: 2: reason 1: open failed =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D Thanks, Paul Langley Network Quality Engineering Network Assurance PCS 913-832-6766 Desk 913-794-5787 |
From: Subir D. <skd...@ya...> - 2007-10-09 14:37:46
|
Hello,=0A=0A =0A=0AI have one query =0Aregarding using perl ssh client to c= onnect novell netware host. I see that perl =0Assh client able to connect n= eware ssh server. Though, it is not able to get the =0Acommand output, if I= try to run the netware command through perl ssh client. Is =0ANet::SSH cli= ent can be used to connect netware host?=0A=0A =0A=0AThanks=0A=0ASubir=0A= =0A =0A=0A=0A=0A=0A=0A =0A___________________________________________= _________________________________________=0ANeed a vacation? Get great deal= s=0Ato amazing places on Yahoo! Travel.=0Ahttp://travel.yahoo.com/ |
From: Mik J <mik...@ya...> - 2007-09-22 14:23:38
|
=0AHello,=0A=0AI have read on the internet some people had problems using n= et::ssh::perl on cisco routers.=0AI have problems too, and I was wondering = if some people managed to make it work ?=0A=0AI'm able to log in the router= but I'm not able to send any commands to it.=0A=0AThe debug output shows t= his=0Arouter: channel 1: new [client-session]=0Arouter: Requesting channel_= open for channel 1.=0Arouter: Entering interactive session.=0Arouter: Chann= el open failure: 1: reason 4:=0A=0AThanx=0A=0A=0A=0A=0A=0A ___________= __________________________________________________________________ =0ANe ga= rdez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail |
From: Umesh B. <u.b...@gm...> - 2007-09-17 07:48:34
|
Hi My sftp script is transfering files at a very slow speed. Normal sftp transfer speeds from the server are around 10 Mb/s. Transfers using the script are around 500 Kb/s. Is this normal? Is there anyway I can speed up the transfer rates? This the ssh portion of my script: use Net::SFTP; use Net::SSH::Perl; sub OpenSSH { my $user = "****"; my $a = "******"; my $Path = "./../../usr/local/logs/"; open (LOGFILE, ">$DataPath/$Month2Word/$Month2Word\_LogFile") || (warn "Can't open file $Month2Word\_LogFile\n"); print LOGFILE "Connecting to $Name ...\n"; close (LOGFILE); my $sftp = Net::SFTP->new($Name,user=>$user,password=>$a,debug=>0,ssh_args=>[port=>22]) || die "Can't connect $@\n"; #make our connection foreach ( $sftp->ls($Path) ) { my $Line = ""; $Line = $_->{filename}; if (($Line ne "\.") && ($Line ne "\.\.") && ($Line =~ m/[0-3][0-9]-$Month2Word-$Year2Work*/) && !($Line =~ m/summary/) ) { $sftp->get("$Path/$Line" , "$DataPath/$Month2Word\_$Type/$Line"); } } } Thanks in advance. |
From: Scott B. <sb...@tr...> - 2007-08-24 17:29:19
|
I am trying to use the NET::SFTP perl module and am getting an error = relating to Kex.pm when running the script from the commandline. =20 I know that sftp works with the site, because if I run just sftp from = the commandline like this (sftp username@sftp_site) it prompts me for a = password and once I enter it, we are connected. =20 I have included the snippit of script as follows: =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 #!/usr/bin/perl =20 # script to get the file specified # on the command line from the # specified ftp site and put it in # specified directory =20 use Net::SFTP; $user =3D "login_name"; $pass =3D "password"; $host =3D "site"; =20 my %args =3D (user=3D>"$user",password=3D>"$pass"); =20 my $sftp =3D Net::SFTP::->new($host,%args,debug=3D>1); =20 $sftp->status; =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Output from Debugging as follows: =20 ft01.trustamerica.com: Reading configuration data /root/.ssh/config ft01.trustamerica.com: Reading configuration data /etc/ssh_config ft01.trustamerica.com: Allocated local port 1023. ft01.trustamerica.com: Connecting to secureftp.ash.profunds.com, port = 22. ft01.trustamerica.com: Remote version string: SSH-2.0-SRT_1.3.1 ft01.trustamerica.com: Remote protocol version 2.0, remote software = version SRT_1.3.1 ft01.trustamerica.com: Net::SSH::Perl Version 1.30, protocol version = 2.0. .t01.trustamerica.com: No compat match: SRT_1.3.1 ft01.trustamerica.com: Connection established. ft01.trustamerica.com: Sent key-exchange init (KEXINIT), wait response. ft01.trustamerica.com: Algorithms, c->s: 3des-cbc hmac-sha1 none ft01.trustamerica.com: Algorithms, s->c: 3des-cbc hmac-sha1 none ft01.trustamerica.com: Entering Diffie-Hellman Group 1 key exchange. ft01.trustamerica.com: Sent DH public key, waiting for reply. ft01.trustamerica.com: Received host key, type 'ssh-dss'. ft01.trustamerica.com: Host 'secureftp.ash.profunds.com' is known and = matches the host key. ft01.trustamerica.com: Computing shared secret key. ft01.trustamerica.com: Verifying server signature. ft01.trustamerica.com: Waiting for NEWKEYS message. Connection closed by remote host. at = /usr/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/Kex.pm line 103 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D _______________________<?xml:namespace prefix =3D o ns =3D = "urn:schemas-microsoft-com:office:office" /> Scott Burks - Manager of Technical Services=20 Trust Company of America / Gemisys Financial Services=20 7103 S Revere Pkwy, Englewood, CO 80112=20 Voice - (303) 705-6049 Fax - (303)705-6171=20 Cell - (303) 588-0594 Email - sb...@tr... =20 |
From: kilaru r. <kil...@gm...> - 2007-08-16 05:04:08
|
Hi All, I have installed Net:SFTP on my UNIX (SOLARIS) machine. I have generated the Public and Private key pair. I have installed the Public on my remote machine with the server as OpenSSH. All the dependent modules are also installed. Please let me know what are all the remaining things I need to configure and how I have to configure them. Thanks, Rajeev Kilaru |
From: Isabelle C. <isa...@in...> - 2007-08-03 11:09:09
|
Hi, I have a problem using Net::SSH::Perl module. I have a script that logs to other machines and make various checkouts from Subversion repositories. The problem is that anonymous checkouts succeed, but checkouts using svn+ssh fail. These checkouts are working if I don't use Net::SSH::Perl, but I'm sure there is a way I can find a solution with this module. Maybe it's just a missing option. Here is part of my code: my $ssh = Net::SSH::Perl->new($host, protocol => '2,1', options => ["BatchMode yes", "ForwardAgent yes", ] ); $ssh->login($user); # then, this anonymous checkout works: cmd($ssh, $host, "svn co svn://scm.gforge.inria.fr/svn/xxxxxxxx"); # but the checkout through svn+ssh fails: cmd($ssh, $host, "svn co svn+ssh://toto\@scm.gforge.inria.fr/svn/xxxxxxxxx"); He is what I get : ____________ Connecting to xxxx, port 22. Remote version string: SSH-1.99-OpenSSH_4.5 Remote protocol version 1.99, remote software version OpenSSH_4.5 Net::SSH::Perl Version 1.30, protocol version 2.0. No compat match: OpenSSH_4.5. Connection established. Sent key-exchange init (KEXINIT), wait response. Algorithms, c->s: 3des-cbc hmac-sha1 none Algorithms, s->c: 3des-cbc hmac-sha1 none Entering Diffie-Hellman Group 1 key exchange. Sent DH public key, waiting for reply. Received host key, type 'ssh-dss'. Host 'pinot' is known and matches the host key. Computing shared secret key. Verifying server signature. Waiting for NEWKEYS message. Enabling incoming encryption/MAC/compression. Send NEWKEYS, enable outgoing encryption/MAC/compression. Sending request for user-authentication service. Service accepted: ssh-userauth. Trying empty user-authentication request. Authentication methods that can continue: publickey. Next method to try is publickey. Publickey: testing agent key '/home/toto/.ssh/id_rsa' Public key is accepted, signing data. Key fingerprint: a6:b9:f5:5b:d8:91:57:df:dexxxxxxxxxxx Login completed, opening dummy shell channel. channel 0: new [client-session] Requesting channel_open for channel 0. channel 0: open confirm rwindow 0 rmax 32768 Got channel open confirmation, requesting shell. Requesting service shell on channel 0. channel 1: new [client-session] Requesting channel_open for channel 1. Entering interactive session. Sending command: svn co svn+ssh://to...@sc.../svn/xxxxxx Requesting service exec on channel 1. channel 1: open confirm rwindow 0 rmax 32768 input_channel_request: rtype exit-status reply 0 channel 1: rcvd eof channel 1: output open -> drain channel 1: rcvd close channel 1: input open -> closed channel 1: close_read channel 1: obuf empty channel 1: output drain -> closed channel 1: close_write channel 1: send close channel 1: full closed Connection closed by 131.254.xxx svn: Connection closed unexpectedly __________ If I don't use Net::SSH::Perl, this works fine: $cmd = "svn co svn+ssh://toto\@scm.gforge.inria.fr/svn/xxxxx"; $cmd = "ssh -o 'BatchMode yes' $host \"$cmd\""; open(OUT,"$cmd 2>&1 |") or die "cannot fork - '$cmd': $!"; while(<OUT>) { print "<$host>\t$_"; } close(OUT); But I wish I could use Net::SSH::Perl. does anyone know what's wrong with my code ? Do I need to use Net::SSH::Perl::Agent ? Thank you, / Isabelle |
From: Ralf W. <mrs...@ya...> - 2007-07-30 15:21:40
|
Hello - First of all I like to thank Morgan Smith from this group for his h= elp in getting the script running using SFTP. The script was tested on a RH= EL5 server, running as a virtual machine. This script requires additional = perl modules.=0A=0AHere is the complete listing:=0A=0A#!/usr/bin/perl -w=0A= # This program transfers files from the host on which it is run to a series= of=0A# hosts as specified in a configuration file, push.ctl.=0A#=0A# Autho= r Ralf Wiegand <my...@my...>=0A# 2002/02: The script was born with= FTP services only and limited error checking.=0A# 07/26/07 Ralf - Added SF= TP - Secure File Transfer Protocol to the push script. This will keep the = current=0A# data structure from the push.ctl file intact.=0A#= 07/27/07 Ralf - fixed overall structure for better readability and added p= roper variables assignments; added use strict and use warning=0A# = Changed to new logic and included testing via unless and eval.=0A# 07/= 30/07 Ralf - Changed if-else-logic, so if a file doesn't get transfered, it= (the file) will not get deleted.=0A#=0A=0A# Declare perl modules=0Ause Net:= :FTP;=0Ause Mail::Sendmail;=0Ause Net::SFTP;=0Ause Net::SSH::Perl;=0Ause st= rict;=0Ause warnings;=0A=0A#### Declare your varibales=0Amy $timestring =3D= localtime();=0Amy $dir =3D "/tmp";=0Amy $ibm =3D "N";=0Amy $ftp_home =3D "= /tmp";=0Amy $hostname =3D "localhost";=0Amy $username =3D "nobody";=0Amy $p= assword =3D "nobody";=0Amy $typ =3D "I";=0Amy $site =3D "localhost";=0Amy $= file =3D "none";=0Amy $trans =3D "T";=0Amy $ipfile =3D "somefile";=0Amy $ft= p =3D "ftp";=0Amy $sftp =3D "sftp";=0Amy $host =3D "localhost";=0A=0A# Prin= t the current date & time whenever this program is called=0A$timestring =3D= localtime();=0Aprint "----------------------------------------------------= ----\n$timestring\n";=0A=0A# The file push.ctl contains information needed = to perform the (s)ftp for each host.=0Aopen(VARIABLES, "push.ctl"); # you n= eed a file called push.ctl within the same directory=0A# Start main while l= oop=0ALINE: while(<VARIABLES>) { # read in data from file and split( use := as divider) the data into variables=0A ($dir,$ibm,$ftp_home,$hostna= me,$username,$password,$typ,$site,$file,$trans)=3Dsplit(/:/);=0A print "= >>>> $dir,$ibm,$ftp_home,$hostname,$username,$password,$typ,$site,$file,$t= rans <<<<< \n";=0A=0A ### Starting trans IF - make a decision if you w= ant to to use SFTP or FTP ###=0A if ($trans eq "S" ) { =0A pri= nt "Using SFTP... >> $trans << \n";=0A my $host =3D $hostname;=0A = my %args =3D (user =3D> $username,=0A password =3D= > $password,=0A ssh_args =3D> [port=3D>22],=0A deb= ug =3D> 0, =0A );=0A=0A # Open the directory that hol= ds the files to be transferred=0A if ( $dir !~ "^\/" ) { ne= xt LINE } ;=0A chdir ($dir) or ftpWarn ("Can't cd to $dir on= myserver;\ndirectory does not exist or permissions are wrong.") && next LI= NE;=0A opendir(LIST,$dir);=0A=0A # If there are f= iles to be transfered, continue.=0A if ( grep !/^\.\.?$/= , readdir (LIST) ) {=0A rewinddir (LIST);=0A=0A = # Connect to the sftp port on the host; cd to the directory = to receive the files.=0A # my $sftp =3D Net::SFTP->new($host= , %args);=0A unless( $sftp =3D eval { Net::SFTP->new($ho= st, %args)} ) { ftpWarn("Cannot connect to $@"); }=0A = print "Connected.\n";=0A=0A # IBM ftp servers require th= at a site command be sent.=0A if ($ibm eq "Y" ) = {=0A print " $ibm was activated with a Y? \n";=0A = unless( eval { $sftp->site($site)}) { ftpWarn= ("Can't issue site command \"$site\" on $hostname;\nfiles in $dir not sent.= ") && next LINE; }=0A }=0A=0A # L= oop through each file, excluding the files that represent the current direc= tory (.)=0A # and parent directory (..).=0A = FILE: foreach $ipfile ( grep !/^\.\.?$/, readdir(LIST) ) { # for loo= p start=0A print "$dir\n";=0A = print "$ipfile\n";=0A if ($file) { # if main st= art=0A if( eval { $sftp->put($ipfile,$file) } ) = { # if A start=0A unlink($ipfile) or ftpWarn= ("Can't delete $ipfile"); # if it worked delete file if not display message= =0A }# if A end =0A = else {=0A ftpWarn("Can't put $ipfile on $h= ostname;\n this could be a timeout or a permissions problem.");=0A = }=0A }=0A else= {=0A if( eval{ $sftp->put($ipfile,$ipfile) } ) = {=0A unlink($ipfile) or ftpWarn("Can't delet= e $ipfile");=0A }=0A = else {=0A ftpWarn("Can't put $ipfile on $ho= stname;\n this could be a timeout or a permissions problem.");=0A = }=0A }=0A}=0A}=0A}=0A else=0A {=0A pr= int "Using FTP.. >>> $trans <<< \n ";=0A # Open the directory that h= olds the files to be transferred=0A if ( $dir !~ "^\/" ) { next= LINE } ;=0A chdir ($dir) or ftpWarn ("Can't cd to $dir on m= yserver;\ndirectory does not exist or permissions are wrong.") && next LINE= ;=0A opendir(LIST,$dir);=0A # If there are files to b= e transfered, continue.=0A if ( grep !/^\.\.?$/, readdir (LIST) = ) {=0A rewinddir (LIST);=0A=0A # Connect to t= he ftp port on the host; cd to the directory to receive the files.=0A = $ftp=3DNet::FTP->new($hostname,"Timeout",600,"Debug",1) or ft= pWarn("$@\nServer $hostname does not respond;\nfiles in $dir not sent.\nFro= m a command line, test the connection by typing 'ftp $hostname'.") && next = LINE;=0A $ftp->login($username, $password) or ftpWarn("I= nvalid login on $hostname;\neither the user name or password is wrong;\nfil= es in $dir not sent.") && next LINE;=0A $ftp->type($typ)= or ftpWarn("Can't set type $typ on $hostname;\nfiles in $dir not sent.") &= & next LINE;=0A if ($ftp_home) {=0A = $ftp->cwd($ftp_home) or ftpWarn("Can't cd to $ftp_home on $hostname;= \ndirectory does not exist or permissions are wrong;\nfiles in $dir not sen= t.") && next LINE;=0A }=0A # IBM ftp servers = require that a site command be sent.=0A if ($ibm eq "Y" = ) {=0A print " $ibm was activated with Y \n";=0A = $ftp->site($site) or ftpWarn("Can't issue site command \"$site\= " on $hostname;\nfiles in $dir not sent.") && next LINE;=0A = }=0A # Loop through each file, excluding the files that repr= esent the current directory (.)=0A # and parent directory (..).= =0A=0A FILE: foreach $ipfile ( grep !/^\.\.?$/, readdir(= LIST) ) {=0A print "$dir\n";=0A = print "$ipfile\n";=0A if ($file) {=0A = if( eval {$ftp->put($ipfile,$file)}) { unlink ($ipfile)= or ftpWarn("Can't put $ipfile on $hostname;\n this could be a timeout or = a permissions problem.");=0A }=0A = else =0A {=0A = if( eval { $ftp->put($ipfile)}) { unlink($ipfile) or ftpWarn("Can't d= elete $ipfile"); } =0A else {=0A = ftpWarn("Can't put $ipfile on $hostname;\n this could be a= timeout or a permissions problem.");=0A = }=0A } # closes else=0A } # = closes id file=0A } # closees foreach loop=0A $ftp->q= uit();=0A } # closes if-grep=0A closedir(LIST);=0A } # c= lose trans else=0A} # close main while=0A=0A=0Asub ftpWarn {=0A=0A my ($= message) =3D @_;=0A=0A warn "$message";=0A=0A my %mail =3D (To = =3D> 'som...@so...',=0A From =3D> 'ftp push scri= pt <somebody here>',=0A Subject =3D> 'FTP push error on FTP = Server servername',=0A smtp =3D> 'servername.mydomane.com',=0A = Message =3D> $message=0A );=0A sendmail(%mail= ) or die $Mail::Sendmail::error;=0A# print "FTP push error: $message\n";= =0A=0A}=0A=0AI'm sure there is room for improvements, but this worked for m= e.=0AHope it will help others.=0A=0AThank You=0ARalf Wiegand=0A=0A=0A=0A=0A= =0A_________________________________________________________________= ___________________=0ABoardwalk for $500? In 2007? Ha! Play Monopoly Here a= nd Now (it's updated for today's economy) at Yahoo! Games.=0Ahttp://get.gam= es.yahoo.com/proddesc?gamekey=3Dmonopolyherenow |
From: Morgan S. <mo...@du...> - 2007-07-26 17:01:02
|
Ralf Wiegand wrote: > # The file push.ctl contains information needed to perform the ftp for > each host. >=20 > open(VARIABLES, "push.ctl"); >=20 > LINE: while(<VARIABLES>) { >=20 > =20 > ($dir,$ibm,$ftp_home,$hostname,$username,$password,$typ,$site,$file)=3D= split(/:/); >=20 > my $host =3D 'xxx.yyy.zzz.aaa'; > my %args =3D (user =3D> "userid", > password =3D> "password", > ssh_args =3D> [port=3D>22]); >=20 >=20 > I'm reading in the information needed to sftp files to a remote server.= =20 > How can I also assign $username to user =3D> ? You could do this: my %args =3D ( user =3D> $username, password =3D> $password, ssh_args =3D> [port=3D>22], ); > So I can reading in IP address ($hostname), user ($username) and > password ($password) from a input file? > Thank You > Ralf >=20 --=20 Morgan Smith Dutro Company 675 North 600 West Logan, UT 84321 (435) 752-3921 x146 GPG Key: 76E09074 Keyserver: http://www.keyserver.net/ |
From: Ralf W. <mrs...@ya...> - 2007-07-26 16:45:12
|
# The file push.ctl contains information needed to perform the ftp for each= host.=0A=0Aopen(VARIABLES, "push.ctl");=0A=0ALINE: while(<VARIABLES>) {=0A= =0A ($dir,$ibm,$ftp_home,$hostname,$username,$password,$typ,$site,$file)= =3Dsplit(/:/);=0A=0A my $host =3D 'xxx.yyy.zzz.aaa';=0A my %args =3D (us= er =3D> "userid",=0A password =3D> "password",=0A = ssh_args =3D> [port=3D>22]);=0A=0A=0AI'm reading in the informatio= n needed to sftp files to a remote server. How can I also assign $username= to user =3D> ?=0ASo I can reading in IP address ($hostname), user ($userna= me) and password ($password) from a input file?=0AThank You=0ARalf=0A=0A=0A= =0A=0A =0A___________________________________________________________= _________________________=0APinpoint customers who are looking for what you= sell. =0Ahttp://searchmarketing.yahoo.com/ |
From: Morgan S. <mo...@du...> - 2007-07-25 19:44:49
|
Oops, I replied but forgot to send it to the list. Ralf Wiegand wrote: > Morgan - Her is a better example.=20 >=20 > my $svt =3D 'ftp.mydomain.com'; > my %cfg =3D (user=3D>'test_user', password =3D> 'secure', debug=3D= >1); With the password in your script, be careful of the script's file permissions as it is a potential security issue. Even though my sshd is configured to use only ssh protocol version 2 I like to let my script know what to expect by putting the following inside my %cfg: protocol=3D>2 > my $sftp =3D Net::SFTP::Recursive->new($svr, %cfg); It may be worth putting statements like this inside an eval so that you can gracefully handle unforeseen errors with connections and commands: unless (my $sftp =3D eval{Net::SFTP::Recursive->new($svr, %cfg) { die "Connection failed: $@"; } I've come across issues where $@ contained errors such as "permission denied" for invalid passwords or disabled accounts, "Can't connect to" for network issues, and I've also rarely come across "connection closed" errors on buggy systems. Seems to me without the eval{} then the script would just die and I had no idea why. My script parsed $@ and was able to clue the user in as to what was going on. Your other script used "or die" to handle errors. With Net::SFTP it didn't work right for me, but eval{} did. > $sftp->rput('/local/mydir', '/remote/dir', \&my_cb); > # with file and dir filters > $sftp->rput('/local/mydir', '/remote/dir', \&my_cb, > {file_pat=3D>'pdf$', dir_pat=3D>'^f', cb4put=3D>\&myput_cb}= ); >=20 > Return: $msg - number of files transferred My suggestion for evaling the the connection would also apply to any commands ($sftp->rput) as well. I like to check the results of every command and this method has helped me to quickly debug/troubleshoot and inform users of all sorts of errors (quota/disk space, permission issues, transfer issues, etc.). Just make sure you keep in mind what is inside of eval{} and what will be returning in order to keep your logic straight. It took me a bit to get the hang of it. As always, 0 and null are different so be sure to check the returned values properly. It may be worth noting that my script used Net::SFTP instead of Net::SFTP::Recursive, so there may be some minor differences. --=20 Morgan Smith Dutro Company 675 North 600 West Logan, UT 84321 (435) 752-3921 x146 GPG Key: 76E09074 Keyserver: http://www.keyserver.net/ |
From: Ralf W. <mrs...@ya...> - 2007-07-25 13:20:52
|
hello - I'm a bit rusty in perl, so I hope to get some pointers or examples= .=0AI need to automate secure file transfer to other clients. the system i= s Solaris 9 and I'm using openssh.=0AThe password and user id has to come f= rom a text file. This is not the safest way, but thats the requirements.= =0AAgain, I'm looking for some how-to, best-way on how to get this started.= =0A=0AThank YOU=0ARalf=0A=0A=0A=0A=0A =0A____________________________= ________________________________________________________=0AMoody friends. D= rama queens. Your life? Nope! - their life, your story. Play Sims Stories a= t Yahoo! Games.=0Ahttp://sims.yahoo.com/ |
From: Mik J <mik...@ya...> - 2007-07-15 12:26:50
|
=0ATry to search in the mailing list history.=0AIt's related to math-bingin= t or another perl module you have to install, I can't remember.=0AThis ques= tion comes frequently so you'll find the answer in the previous posts=0A=0A= ----- Message d'origine ----=0ADe : thomas elsgaard <thomas.elsgaard@gmail.= com>=0A=C0 : ssh...@li...=0AEnvoy=E9 le : Mard= i, 5 Juin 2007, 16h30mn 28s=0AObjet : [Ssh-sftp-perl-users] Very long time = to ssh login=0A=0AHello Guys=0A=0A =0A=0AIs there anyone that can tell me w= hy it takes 22 seconds to do a ssh2 login with Net::ssh:perl ? and is there= any way to speed up the login?=0A=0A =0A=0AIt seems that it's the:=0A=0A = =0A=0AAlgorithms, c->s: 3des-cbc hmac-sha1 none=0AAlgorithms, s->c: 3des-cb= c hmac-sha1 none=0A=0A =0A=0Aand:=0A=0A =0A=0AComputing shared secret key.= =0A=0A =0A=0AThat takes most of the time.=0A=0A =0A=0A///Thomas=0A=0A------= -------------------------------------------------------------------=0AThis = SF.net email is sponsored by DB2 Express=0ADownload DB2 Express C - the FRE= E version of DB2 express and take=0Acontrol of your XML. No limits. Just da= ta. Click to get it now.=0Ahttp://sourceforge.net/powerbar/db2/=0A_________= ______________________________________=0ASsh-sftp-perl-users mailing list= =0AS...@li...=0Ahttps://lists.sourceforge.ne= t/lists/listinfo/ssh-sftp-perl-users=0A=0A=0A=0A=0A=0A=0A=0A _________= _____________________________________________________________________ =0ASt= ockage illimit=E9 de vos mails avec Yahoo! Mail. Changez aujourd'hui de mai= l ! |
From: Peter G. <pe...@pg...> - 2007-07-11 19:50:27
|
I am using Net-SSH-Perl and need to access a lot of computers (more than 30, and possibly more) simultaneously, and would like to send off the login and commands, and get the results as as when they become ready. Currently, login and cmd, send the commands and wait for the replies. Is there any way to fire off the login and cmd requests and then come back later, using polling or whatever, to get the results. Thanks, Peter |
From: <eri...@wa...> - 2007-06-27 11:49:00
|
I will be out of the office starting 06/22/2007 and will not return until 07/09/2007. I will respond to your message when I return. If its an emergency please contact Todd Hedrick, Bill Lockley, Don Boenitz or Tim Delrose. |
From: <<<<Amar>>>> <ama...@gm...> - 2007-06-27 11:46:48
|
hello all, I installed the NET::SSH::Perl module on my SunOS 5.9 sparc (with the Sun compiler )with the command perl -MCPAN -e 'install Net::SSH::Perl' and it got installed "hopefully" bcos i got the message " Net::SSH::Perl is up to date (1.30)." but when i try to run the my script which uses this module, i get errors. the script is as follows use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("veasol9-02.vxindia.veritas.com"); $ssh->login($user, varsha); my($stdout, $stderr, $exit) = $ssh->cmd(ls); and the error after running the above script is Can't locate Math/Pari.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/Util/SSH2MP.pm line 6. BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/Util/SSH2MP.pm line 6. Compilation failed in require at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/Util.pm line 56. BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/Kex/DH1.pm line 10. Compilation failed in require at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/Kex.pm line 6. BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/Kex.pm line 6. Compilation failed in require at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/SSH2.pm line 6. BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl/SSH2.pm line 6. Compilation failed in require at /usr/perl5/site_perl/5.6.1/Net/SSH/Perl.pm line 54. then i try to install the Math::Pari module as follows... perl -MCPAN -e 'install Math::Pari' and i get the error========> Getting GP/PARI from ftp://megrez.math.u-bordeaux.fr/pub/pari/unix/ Can't locate Net/FTP.pm in @INC (@INC contains: utils /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at utils/Math/PariBuild.pm line 236, <STDIN> line 1. Can't fetch file with Net::FTP, now trying with LWP::UserAgent... You do not have LWP::UserAgent and/or HTML::LinkExtor installed, cannot download, exiting... at utils/Math/PariBuild.pm line 265, <STDIN> line 1. Warning: No success on command[/usr/bin/perl Makefile.PL] Warning (usually harmless): 'YAML' not installed, will not store persistent state ILYAZ/modules/Math-Pari-2.010709.tar.gz /usr/bin/perl Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read '/.cpan/build/Math-Pari-2.010709-ttnpyy/META.yml'. Falling back to other methods to determine prerequisites ----end of error------------- So the question is though all the dependent modules were installed(bcos i use >> perl -MCPAN -e 'install Net::SSH::Perl') still why it is asking me for other modules to load. N plz help me by telling me how to load the Math::Pari module on my SunOS 5.9 sparc. Amar. |
From: thomas e. <tho...@gm...> - 2007-06-05 14:30:29
|
Hello Guys Is there anyone that can tell me why it takes 22 seconds to do a ssh2 login with Net::ssh:perl ? and is there any way to speed up the login? It seems that it's the: Algorithms, c->s: 3des-cbc hmac-sha1 none Algorithms, s->c: 3des-cbc hmac-sha1 none and: Computing shared secret key. That takes most of the time. ///Thomas |
From: Alessandro De M. <ale...@tr...> - 2007-06-05 13:28:26
|
Hi all, I have solved the problem reading from the psftp source code. Thanks Alex p.s. it now looks like this: my $sftp = Net::SFTP->new($sftp_server, ssh_args => [options => [ "IdentityFile ~/.ssh/id_rsa" , ]]); On Tue, 2007-06-05 at 13:29 +0100, Alessandro De Maria wrote: > Hi all, > > I beg your help for a problem I have trying to use the Net::SFTP module. > I'm trying to create a script that will move files using an sftp > connection. > > I will have to use just the publickey authentication. > > I have written a little script just to connect and make sure I can > simply put a file there, just as a test, but even if the "password" > authentication works, I can't have the publickey to get into action. > > Regards > Alex > > > > |
From: Alessandro De M. <ale...@tr...> - 2007-06-05 12:31:02
|
Hi all, I beg your help for a problem I have trying to use the Net::SFTP module. I'm trying to create a script that will move files using an sftp connection. I will have to use just the publickey authentication. I have written a little script just to connect and make sure I can simply put a file there, just as a test, but even if the "password" authentication works, I can't have the publickey to get into action. here the script ########################################################## #!/usr/bin/perl -w use Net::SFTP; $sftp_server = "my_server"; @keys = ("/home/myuser/.ssh/id_rsa"); my $sftp = Net::SFTP->new($sftp_server, ( user => 'myuser', debug =>3, protocol =>'2,1', options=>["IdentityFile ~/.ssh/id_rsa"] )); I have tried a NUMBER of combination, even passin the \@keys or having identity_files => ["~/.ssh/id_rsa"]. I have also copied "id_rsa" to "identity" and removed the IdentityFile to have the key to be picked up as default. #################### and I have even tried just the use Net::SSH::Perl module: my $ssh = Net::SSH::Perl->new($sftp_server, debug =>'3', identity_files => ["~/.ssh/id_rsa"] ); $ssh->login('myuser'); my($stdout, $stderr, $exit) = $ssh->cmd('ls'); print $stdout; Running on fedora 6. perl, v5.8.8 modules installed through cpan. Module = Net::SFTP (DBROBINS/Net-SFTP-0.10.tar.gz) #### in case you wonder: [myuser@laptop10 .ssh]$ ls -l total 36 -rw------- 1 myuser myuser 440 Jun 4 17:06 authorized_keys -rw------- 1 myuser myuser 1679 May 14 14:07 id_rsa -rw-r--r-- 1 myuser myuser 411 May 14 14:07 id_rsa.pub -rw-r--r-- 1 myuser myuser 6813 May 25 16:03 known_hosts -rw-rw-r-- 1 myuser myuser 1192 Jun 5 11:08 known_hosts2 #### I can also successfully ssh to the server above using my id_rsa key: [myuser@laptop10 ~]$ ssh my_server Last login: Tue Jun 5 11:22:25 2007 from 217.207.105.92 Access for authorised personnel only [myuser@my_server myuser]$ here is the debug I get: ####################################################### laptop10.tradocs.net: Reading configuration data /home/myuser/.ssh/config laptop10.tradocs.net: Reading configuration data /etc/ssh_config laptop10.tradocs.net: Connecting to wb2, port 22. laptop10.tradocs.net: Remote version string: SSH-2.0-OpenSSH_3.6.1p2 laptop10.tradocs.net: Remote protocol version 2.0, remote software version OpenSSH_3.6.1p2 laptop10.tradocs.net: Net::SSH::Perl Version 1.30, protocol version 2.0. laptop10.tradocs.net: No compat match: OpenSSH_3.6.1p2. laptop10.tradocs.net: Connection established. laptop10.tradocs.net: Sent key-exchange init (KEXINIT), wait response. laptop10.tradocs.net: Algorithms, c->s: 3des-cbc hmac-sha1 none laptop10.tradocs.net: Algorithms, s->c: 3des-cbc hmac-sha1 none laptop10.tradocs.net: Entering Diffie-Hellman Group 1 key exchange. laptop10.tradocs.net: Sent DH public key, waiting for reply. laptop10.tradocs.net: Received host key, type 'ssh-dss'. laptop10.tradocs.net: Host 'wb2' is known and matches the host key. laptop10.tradocs.net: Computing shared secret key. laptop10.tradocs.net: Verifying server signature. laptop10.tradocs.net: Waiting for NEWKEYS message. laptop10.tradocs.net: Enabling incoming encryption/MAC/compression. laptop10.tradocs.net: Send NEWKEYS, enable outgoing encryption/MAC/compression. laptop10.tradocs.net: Sending request for user-authentication service. laptop10.tradocs.net: Service accepted: ssh-userauth. laptop10.tradocs.net: Trying empty user-authentication request. laptop10.tradocs.net: Authentication methods that can continue: publickey,password,keyboard-interactive. laptop10.tradocs.net: Next method to try is publickey. laptop10.tradocs.net: Next method to try is password. laptop10.tradocs.net: Trying password authentication. laptop10.tradocs.net: Authentication methods that can continue: publickey,password,keyboard-interactive. laptop10.tradocs.net: Next method to try is publickey. laptop10.tradocs.net: Next method to try is password. laptop10.tradocs.net: Trying password authentication. laptop10.tradocs.net: Authentication methods that can continue: publickey,password,keyboard-interactive. laptop10.tradocs.net: Next method to try is publickey. laptop10.tradocs.net: Next method to try is password. laptop10.tradocs.net: Trying password authentication. laptop10.tradocs.net: Authentication methods that can continue: publickey,password,keyboard-interactive. laptop10.tradocs.net: Next method to try is publickey. laptop10.tradocs.net: Next method to try is password. Could you please help me in identifying what am I doing wrong? Regards Alex |
From: Ong, Q. (N-Titan) <qua...@lm...> - 2007-06-01 00:06:36
|
For those who have been able to successfully use the Net::SFTP module, what kind of transfer rates are you getting? We have it successfully installed (with GMP libs) and it seems to work, but the transfer rate seems artificially limited. Using Net::SFTP, we get like 900+kb/sec transfer rates (on an ethernet LAN). Using the command line sftp, we get almost 8MB/sec transfers (20MB/sec transfers via FTP). However, using the Net::SFTP module, the most we ever get is 150-170kb/sec. I don't think it's CPU bound because it never uses more than 45% of the CPU. I borrowed this code (thanks David F) from another poster as a simple test script (but used a much bigger file, 15MB): #!/usr/bin/perl use strict; use warnings; use Net::SFTP; #Create with: dd if=/dev/urandom of=/tmp/1mb.junk bs=1024 count=1024 # I used a 15MB file instead of 1MB to get more reliable stats my $testfile = "/tmp/1mb.junk"; my %comm = ( user => 'USER', password => 'PASSWORD', ssh_args => [ cipher => '3des-cbc' ], debug => 1, ); # Connec to local host to remove any network latency issues my $sftp = Net::SFTP->new('localhost', %comm) or die "oops: $@"; $sftp->put ($testfile, "$testfile.test") or die("ftp put failed ", $sftp->message); END{ print map{"$_\n"} sort keys %INC; #check for GMP/Pari } __END__ Thanks, Quang |
From: Mark F. <mf...@tr...> - 2007-05-24 22:35:53
|
Folks, wrote this sftp script and it works great, I have connected to a few servers with no problems then.... I got this error trying to connect to an external host. Anybody know what's up with this? D:\scripts>perl tcp_sftp.pl -f svstest.ftp -v 1 -r . -c ls Using a file for the commands......... filename is ->svstest.ftp<- ......... Reading commands file............please wait... HOST:-->ftp.test.iconnectdata.com<- PORT->10022<- USER->auser<- PWD->xxxxxx<- program_dir = . 0->tcp_sftp.pl<- Base Directory-><- Basename->tcp_sftp<- LOG->/logs/tcp_sftp-05-24-2007.log<- Starting SFTP Session at 05-24-2007 18:27:00 for <ftp://ftp.test.iconnectdata.com> ftp.test.iconnectdata.com.......................... Attempting to log into <ftp://ftp.test.iconnectdata.com> ftp.test.iconnectdata.com using auser.................... TCPITM6: Reading configuration data /.ssh/config TCPITM6: Reading configuration data /etc/ssh_config TCPITM6: Connecting to <ftp://ftp.test.iconnectdata.com> ftp.test.iconnectdata.com, port 10022. TCPITM6: Socket created, turning on blocking... TCPITM6: Remote protocol version 2.0, remote software version Connect:Enterprise_UNIX_2.2.00 TCPITM6: Net::SSH::Perl Version 1.23_01, protocol version 2.0. TCPITM6: No compat match: Connect:Enterprise_UNIX_2.2.00. TCPITM6: Connection established. TCPITM6: Sent key-exchange init (KEXINIT), wait response. TCPITM6: Algorithms, c->s: 3des-cbc hmac-sha1 none TCPITM6: Algorithms, s->c: 3des-cbc hmac-sha1 none TCPITM6: Entering Diffie-Hellman Group 1 key exchange. TCPITM6: Sent DH public key, waiting for reply. TCPITM6: Received host key, type 'ssh-rsa'. TCPITM6: Host 'ftp.test.iconnectdata.com' is known and matches the host key. TCPITM6: Computing shared secret key. TCPITM6: Verifying server signature. TCPITM6: Waiting for NEWKEYS message. TCPITM6: Enabling incoming encryption/MAC/compression. TCPITM6: Send NEWKEYS, enable outgoing encryption/MAC/compression. TCPITM6: Sending request for user-authentication service. TCPITM6: Service accepted: ssh-userauth. TCPITM6: Trying empty user-authentication request. TCPITM6: Authentication methods that can continue: publickey,password,keyboard-interactive. TCPITM6: Next method to try is publickey. TCPITM6: Trying pubkey authentication with key file '/.ssh/known_hosts2' TCPITM6: Will not query passphrase for '/.ssh/known_hosts2' in batch mode. TCPITM6: Loading private key failed. TCPITM6: Next method to try is password. TCPITM6: Trying password authentication. TCPITM6: Login completed, opening dummy shell channel. TCPITM6: channel 0: new [client-session] TCPITM6: Requesting channel_open for channel 0. TCPITM6: channel 0: open confirm rwindow 0 rmax 32768 TCPITM6: Got channel open confirmation, requesting shell. TCPITM6: Requesting service shell on channel 0. TCPITM6: channel 1: new [client-session] TCPITM6: Requesting channel_open for channel 1. IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 Received disconnect message: Unsupported request (shell). at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 281 Thanks, David M. Funk President/CEO Tivoli Certified Enterprise Consultant Specializing in Network and Systems Management Solutions Trinity Solutions 604 Cassandra Dr. Suite 204 Cranberry Twp., PA 16066 Phone: 724-316-0721 Fax: 724-772-7889 email: mf...@tr... |
From: Mark F. <mf...@tr...> - 2007-05-23 18:59:23
|
Folks, I wrote an SFTP perl script on windows and am getting some strange output. Anybody seen the follow before? D:\scripts>perl d:\scripts\sftp1.pl mark@tservsyslog <blocked::mailto:mark@tservsyslog> -r /home/mark -c ls Please enter password : xxxxxxxx IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 drwxr-xr-x 4 mark mark 4096 May 21 06:44 . drwxr-xr-x 8 root root 4096 Jul 12 2006 .. -rw------- 1 mark mark 6084 May 21 09:37 .bash_history -rw-r--r-- 1 root root 1186 Jun 28 2005 .alias -rw-r--r-- 1 root root 147 Jun 28 2005 .bashrc -rw-r--r-- 1 mark mark 257 Oct 5 2005 .bash_profile -rw------- 1 mark mark 5776 Sep 21 2006 .viminfo drwxr-xr-x 2 mark mark 4096 Sep 20 2006 test drwxr-xr-x 2 mark mark 4096 Aug 17 2005 .ssh -rw-r--r-- 1 mark mark 6 Oct 4 2005 dmf.123 -rw-r--r-- 1 mark mark 395 Sep 20 2006 ftp.pl <blocked::ftp://ftp.pl/> -rw-r--r-- 1 mark mark 730 Dec 1 2005 errpt.tar.bz2 -rw-rw-rw- 1 mark mark 13 May 21 14:07 dmf1.txt IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 D:\scripts> Let me know how to suppress it Thanks, David M. Funk President/CEO Tivoli Certified Enterprise Consultant Specializing in Network and Systems Management Solutions Trinity Solutions 604 Cassandra Dr. Suite 204 Cranberry Twp., PA 16066 Phone: 724-316-0721 Fax: 724-772-7889 email: mf...@tr... |