Good evening all, I'm trying to script control of a network device. I have it working okay with Net::Telnet, but I really need to script this with SSH. Unfortunately the device has a very rudimentary implementation of SSH. I can login, but fail rather quickly with the error "Channel open failure: 1: reason 4: Server supports one session per SSH client"

It's my first try with Net::SSH::Perl, and at this point all the script does is issue a $ssh->login and attempts to send a command with $ssh->cmd

I've looked through the various module docs and didn't see anything that looked hopeful in restricting the number of concurrent "sessions". Here is a debug log of the failure. Am I using the right perl module for the task? Any suggestions on how to restrict to a single session?

The device I'm trying to access has a very irregular command structure with varying prompts, some asynchronous messages, so the eventual script becomes pretty complex.

admin1@10.2.56.13's password: myhost: Login completed, opening dummy shell channel. myhost: channel 0: new [client-session] myhost: Requesting channel_open for channel 0. myhost: channel 0: open confirm rwindow 1000 rmax 1000 myhost: Got channel open confirmation, requesting shell. myhost: Requesting service shell on channel 0. myhost: channel 1: new [client-session] myhost: Requesting channel_open for channel 1. myhost: Entering interactive session. myhost: Channel open failure: 1: reason 4: Server supports one session + per SSH client
Thanks George

In reply to SSH with Net::SSH::Perl fails "one session per SSH Client" by geo_pmonk

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.