Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Weird error with Cryprt::Blowfish and Crypt::DES

by Anonymous Monk
on Mar 03, 2009 at 11:33 UTC ( #747691=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Weird error with Cryprt::Blowfish and Crypt::DES
in thread Weird error with Cryprt::Blowfish and Crypt::DES

I am having this exact same problem, but don't understand how you implemeneted your fix. Where are you adding 'utf8::downgrade' because when I add it to the data I send as the username to Net::SSH::Perl it sends the data as '1'. I know this is an old thread but hopefully someone will know what I need to do to fix this. Thanks


Comment on Re^4: Weird error with Cryprt::Blowfish and Crypt::DES
Replies are listed 'Best First'.
Re^5: Weird error with Cryprt::Blowfish and Crypt::DES
by Corion (Pope) on Mar 03, 2009 at 11:37 UTC
      Thanks for the reply.
      I tried that but adding the utf8::downgrade only made my variable change to '1'.
      Here is my code
      use Net::SSH::Perl; use XML::Simple; do "routines/Log.pm"; my $c_rsync = "$Bin/conf/plugins/rsync.xml"; unless (-e "$c_rsync" ) { Log ( $l_plugin , "no config file was found, exiting" ); exit; } my $xml_conf = eval { XMLin ( $c_rsync , ForceArray => [ 'rsync' ] , K +eyAttr => {} , KeepRoot => 0 ) }; if ($@) { Log ( $l_plugin , "failed to load plugin \'rsync\' xml.\nReason: $ +@" ); exit; } my ( @rFolder , @rUser , @rIp , @rHome , @rProxy ); foreach (@{ $xml_conf -> {'plugin'} -> {'rsync'} }) { push ( @rFolder , $_ -> {'loc'} ); push ( @rUser , $_ -> {'uname'} ); push ( @rIp , $_ -> {'ip'} ); push ( @rHome , $_ -> {'fol'} ); if ( defined ( $_ -> {'proxy'} ) ) { push ( @rProxy , $_ -> {'proxy'} ); } else { push ( @rProxy , 0 ); } } my $cV = 0; foreach ( @rFolder ) { my $rSsh = Net::SSH::Perl -> new ( $rIp[$cV] , protocol => '2,1' , ide +ntity_files => [ "/root/rsync/$rUser[$cV]-rsync-key" ] , debug => 1 ) +; $rSsh -> login ( $rUser[$cV] ); my ( $oMsg , $oErr , $oExit ) = $rSsh -> cmd ( "du" ); print "$oMsg"; $cV++; } exit;
      I removed the parts not related to the Net::SSH::Perl stuff.
      The code works great when I replace $rSsh -> login ( $rUser[$cV] ); with $rSsh -> login ( 'yams-dev' );
      and $rUser[$cV] is definatley giving 'yams-dev' without any newlines on the end or anything odd like that.
      This is the debug output I'm getting:
      suse-build: Reading configuration data /root/.ssh/config suse-build: Reading configuration data /etc/ssh_config suse-build: Allocated local port 1022. suse-build: Connecting to 87.117.247.76, port 22. suse-build: Remote protocol version 1.99, remote software version Open +SSH_3.4p1 suse-build: Net::SSH::Perl Version 1.34, protocol version 2.0. suse-build: No compat match: OpenSSH_3.4p1. suse-build: Connection established. suse-build: Sent key-exchange init (KEXINIT), wait response. suse-build: Algorithms, c->s: 3des-cbc hmac-sha1 none suse-build: Algorithms, s->c: 3des-cbc hmac-sha1 none suse-build: Entering Diffie-Hellman Group 1 key exchange. suse-build: Sent DH public key, waiting for reply. suse-build: Received host key, type 'ssh-dss'. suse-build: Host '87.117.247.76' is known and matches the host key. suse-build: Computing shared secret key. suse-build: Verifying server signature. suse-build:/home/matt/rsync # perl rsync.pm suse-build: Waiting for NEWKEYS message. suse-build: Send NEWKEYS. suse-build: Enabling encryption/MAC/compression. suse-build: Sending request for user-authentication service. suse-build: Service accepted: ssh-userauth. suse-build: Trying empty user-authentication request. input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.8/i586-linu +x-thread-multi/Crypt/DES.pm line 56.
      Thanks for the reply (sorry for the dupe post, my first was made anon and I realised I had a couple of errors in the copy/paste).
      I tried that but adding the utf8::downgrade only made my variable change to '1'.
      Here is my code
      use Net::SSH::Perl; use XML::Simple; do "routines/Log.pm"; my $c_rsync = "$Bin/conf/plugins/rsync.xml"; unless (-e "$c_rsync" ) { Log ( $l_plugin , "no config file was found, exiting" ); exit; } my $xml_conf = eval { XMLin ( $c_rsync , ForceArray => [ 'rsync' ] , K +eyAttr => {} , KeepRoot => 0 ) }; if ($@) { Log ( $l_plugin , "failed to load plugin \'rsync\' xml.\nReason: $ +@" ); exit; } my ( @rFolder , @rUser , @rIp , @rHome , @rProxy ); foreach (@{ $xml_conf -> {'plugin'} -> {'rsync'} }) { push ( @rFolder , $_ -> {'loc'} ); push ( @rUser , $_ -> {'uname'} ); push ( @rIp , $_ -> {'ip'} ); push ( @rHome , $_ -> {'fol'} ); if ( defined ( $_ -> {'proxy'} ) ) { push ( @rProxy , $_ -> {'proxy'} ); } else { push ( @rProxy , 0 ); } } my $cV = 0; foreach ( @rFolder ) { my $rSsh = Net::SSH::Perl -> new ( $rIp[$cV] , protocol => '2,1' , ide +ntity_files => [ "/root/rsync/$rUser[$cV]-rsync-key" ] , debug => 1 ) +; $rSsh -> login ( $rUser[$cV] ); my ( $oMsg , $oErr , $oExit ) = $rSsh -> cmd ( "du" ); print "$oMsg"; $cV++; } exit;
      I removed the parts not related to the Net::SSH::Perl stuff.
      The code works great when I replace $rSsh -> login ( $rUser[$cV] ); with $rSsh -> login ( 'yams-dev' );
      and $rUser[$cV] is definatley giving 'yams-dev' without any newlines on the end or anything odd like that.
      This is the debug output I'm getting:
      suse-build: Reading configuration data /root/.ssh/config suse-build: Reading configuration data /etc/ssh_config suse-build: Allocated local port 1022. suse-build: Connecting to **.117.247.**, port 22. suse-build: Remote protocol version 1.99, remote software version Open +SSH_3.4p1 suse-build: Net::SSH::Perl Version 1.34, protocol version 2.0. suse-build: No compat match: OpenSSH_3.4p1. suse-build: Connection established. suse-build: Sent key-exchange init (KEXINIT), wait response. suse-build: Algorithms, c->s: 3des-cbc hmac-sha1 none suse-build: Algorithms, s->c: 3des-cbc hmac-sha1 none suse-build: Entering Diffie-Hellman Group 1 key exchange. suse-build: Sent DH public key, waiting for reply. suse-build: Received host key, type 'ssh-dss'. suse-build: Host '87.117.247.76' is known and matches the host key. suse-build: Computing shared secret key. suse-build: Verifying server signature. suse-build: Waiting for NEWKEYS message. suse-build: Send NEWKEYS. suse-build: Enabling encryption/MAC/compression. suse-build: Sending request for user-authentication service. suse-build: Service accepted: ssh-userauth. suse-build: Trying empty user-authentication request. input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.8/i586-linu +x-thread-multi/Crypt/DES.pm line 56.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://747691]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2015-07-30 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls