Could you show us your code. I've done a lot of development this last year using this module. I believe I used 'shell' when sending commands over the established channel. I don't recall it closing the channel but it's been awhile since I've written code with this module.

I recall having a lot of problems with STDERR and this module. Is this what you are having difficulty with? From the channel module page it says:
shell

Start a shell on the remote host; calls process("shell").

exec ( command )

Execute the command on the remote host; calls process("exec", command). Note that only one of these requests can succeed per channel (cp. "exec" in perlfunc); if you want to run a series of commands, consider using shell instead.

I recommend 'shell'. It worked well for me. Post the code and we'll check it out.

BTW, while this module is still immature IMO (not even at 1.0 I think). David has done a fantastic job and it's far better than the original NET::SSH::PERL IMO. I've been able to hit a couple hundred Unix/Linux servers in a few minutes and run inventory reports. It's very speedy and does a great job. We're now using it to create user accounts and set passwords in minutes rather than days.

Yeah it's archaic but we can't decide how to tie everything together with LDAP and I was tired of waiting for management to approve funding :-)

In reply to Re^2: Net::SSH2 Interactive command example by u235sentinel
in thread Net::SSH2 Interactive command example by shooter

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.