FWIW, $params{'debug') = 'true' spits out a lot of debug information as the script is running, which coincidentally takes a long time. I got a bunch of this, (trimmed for brevity, anyone who's watched the output of ssh -v hostname will appreciate that)

$ perl netssh.pl localhost: Reading configuration data /Users/username/.ssh/config localhost: Reading configuration data /etc/ssh_config localhost: Connecting to www.c2group.net, port 22. localhost: Remote protocol version 1.99, remote software version OpenS +SH_<some_version> FreeBSD localhost: Net::SSH::Perl Version 1.29, protocol version 2.0. localhost: No compat match: OpenSSH_<some_version> FreeBSD. localhost: Connection established. localhost: Sent key-exchange init (KEXINIT), wait response. localhost: Algorithms, c->s: 3des-cbc hmac-sha1 none localhost: Algorithms, s->c: 3des-cbc hmac-sha1 none localhost: Entering Diffie-Hellman Group 1 key exchange. localhost: Sent DH public key, waiting for reply. localhost: Received host key, type 'ssh-dss'.

... and finally:

Output: Exit Code: 0

I've already changed the my( my $stdout, my $stderr, my $exit2 ) line to remove the superflous "my"s... and now I notice the following:

if ($stdout){print "Output:\n$_\n\n";}

$_ doesn't contain anything at that point, so this would work better:

if ($stdout){print "Output:\n$stdout\n\n";}

As far as your original problem, do you have any special characters in your password that might be gumming up the works? (%, @, $ would all need to be escaped out of your password, especially if you have it in double quotes as your example code above)



--chargrill
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );

In reply to Re^4: SSH connection error by chargrill
in thread SSH connection error by dolavoie

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.