Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Net::SSH::Perl problems with $ssh->login and $ssh->cmd - function

by polyp (Initiate)
on Jun 25, 2003 at 12:09 UTC ( #268825=perlquestion: print w/replies, xml ) Need Help??

polyp has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I am using Net:SSH::Perl to establish a SSH connection but get an error when using variables as user and password.

The source code:
print("Username: "); $user = <STDIN>; chomp($user); print("Pass: "); $pass = <STDIN>; chomp($pass); $ssh->login($user,$pass); # $ssh is introduced earlier, of course
does not work !

The error message is:

input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.0/i386-linu +x-thread-multi/Crypt/DES.pm line 57.
When not using variables everything works fine:
#source: $ssh->login("root","root_pass");
The same thing happens when using the cmd-function,
$ssh->cmd($curr_cmd); does not work $ssh->cmd("ls -l"); DOES work !
Even the example script cmd.pl, which can be found at http://search.cpan.org/src/BTROTT/Net-SSH-Perl-1.23/eg/cmd.pl does not work and exits with the same error.

Does anybody know where my problem is ? I am running RedHat 9.0 with updated Perl modules (from CPAN).

Thanks for your help.

Markus

edited: Wed Jun 25 13:50:16 2003 by jeffa - code tags, removed br tags, linked url

Replies are listed 'Best First'.
Re: Net::SSH::Perl problems with $ssh->login and $ssh->cmd - function
by crouchingpenguin (Priest) on Jun 25, 2003 at 12:36 UTC

    You want to use a CBC cipher with your Net::SSH::Perl object. Change your constructor to:

    my $ssh = Net::SSH::Perl->new($host, cipher => '3des-cbc' || 'blowfish-cbc', );

    cp
    ----
    "Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."
      Is it possible to use ordinary DES cipher because as the next error says - the remote host does not support 3des.

      Error: Selected cipher type 3des-cbc not supported by server.

      Markus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://268825]
Approved by martymart
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2021-10-22 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?