Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
SSHing in with an explicit user/password seems not to work for me using Net::SSH::Perl.

This seems to be the same problem, or a related problem, as in Net::SSH::Perl gotcha!

That was back in 2002, and I'm thinking there must be a fix in, or at least a better understanding of the problem. But I looked around and couldn't find anything.

Here is a snip from my terminal to show what is going wrong

Is there some gotcha involving Net::SSH::Perl that I need to know about?

$ ssh thartman@localhost # works fine Password: Linux none 2.4.29-linode39-1um #1 Wed Jan 19 12:22:14 EST 2005 i686 GN +U/Linux... etc, etc $ exit # get back to my original process logout Connection to localhost closed. $ cat net-ssh-perl.t # the code to connect via Net::SSH::Perl use strict; use warnings; use Net::SSH::Perl; use IO::Prompt; my $ssh_box = 'localhost'; my $ssh_login = prompt "$ssh_box user: "; my $ssh_password = prompt "$ssh_box password: ", -e => '*'; my $ssh = Net::SSH::Perl->new($ssh_box); $ssh->login($ssh_login, $ssh_password); $ perl net-ssh-perl.t # same login, same password localhost user: thartman localhost password: ********* Permission denied at net-ssh-perl.t line 14 $ head -n14 net-ssh-perl.t | tail -n 1 # echo line 14 -- of course, it +'s the login $ssh->login($ssh_login, $ssh_password); $

Much obliged for anybody that can point me in the right direction.

UPDATE, fwiw, doing the same thing with Net::SSH works fine

$ perl net-ssh.t localhost user: thartman localhost command: ls blee learning nbarter pari-2.1.7 pari-2.1.7.tgz pimpmycat pmc_external_dependencies shellenv $ cat net-ssh.t use strict; use warnings; use Net::SSH qw(sshopen2); use IO::Prompt; my $ssh_box = "localhost"; my $user = prompt "$ssh_box user: ";; my $cmd = prompt "$ssh_box command: "; sshopen2("$user\@$ssh_box", *READER, *WRITER, "$cmd") || die "ssh: $!" +; while (<READER>) { chomp(); print "$_\n"; } close(READER); close(WRITER);

In reply to Is Net::SSH::Perl broken for login via explicit user/password? by tphyahoo

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 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?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-16 18:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found