Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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


In reply to Net::SSH::Perl problems with $ssh->login and $ssh->cmd - function by polyp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2021-11-27 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?