in reply to SSH with Net::SSH::Perl fails "one session per SSH Client"

A quick look at the docs indicates setting the "use_pty => 0" option should prevent Net::SSH::Perl asking for a another channel. It does this by default but only uses it if you want to use the shell functionality. {untested speculation}

If not: Can you actually login using a command line SSH tool? Can you install Net::SSH? If so you should find Net::SSH works for you as it just a thin wrapper over the command line SSH.

  • Comment on Re: SSH with Net::SSH::Perl fails "one session per SSH Client"

Replies are listed 'Best First'.
Re^2: SSH with Net::SSH::Perl fails "one session per SSH Client"
by geo_pmonk (Initiate) on May 24, 2008 at 02:26 UTC
    Thanks! I'll give that a try when I'm back into work. I can log in with command line SSH, so that part works. Has to be userid/password login. Keys based ssh is not supported. I had looked at Net::SSH but wasn't sure where the eventual script would live, and didn't want to be dependent upon the underlying SSH. Also, it looked like I'd need to map a pty to the Net::SSH to support userid/password login. George

      Looking at the docs:

      $ssh->login([ $user [, $password [, $suppress_shell ] ] ]) [snip] By default, Net::SSH::Perl will open a channel with a shell on it. Thi +s is usually what you want. If you are tunneling another protocol ove +r SSH, however, you may want to prevent this behavior. Passing a true + value in $suppress_shell will prevent the shell channel from being o +pened (SSH2 only).

      {begin speculation}

      SSH1 does not support multiple channels, only SSH2 does AFAIK. The ChannelMgr.pm which opens the channels is only active for SSH2 and generates the error message you see. Given the default is try SSH1 first, then SSH2 your script is making the connection via SSH2. This in itself may be the issue as your "broken" SSH implementation does not support SSH2 (says it only supports one channel) but may not do the right thing to tell Net::SSH::Perl that it isa/wants SSH1. Easy to test, just set it to work on SSH1 only and see if it chokes.

      I presume that setting Net::SSH::Perl to only use SSH1 (all your widget aparrently supports) will cause it to fail. You will then need to look at the handshake coming from your widget to see why it is not recognised as SSH1 and patch Net::SSH::Perl to recognise it and talk SSH1.

      {noitaluceps dne}