www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Issue connecting to Netscreen/Juniper devices

Issue connecting to Netscreen/Juniper devices

From: Benjamin Krajmalnik <bkrajmalnik_at_gmail.com>
Date: Tue, 29 May 2012 15:45:39 -0600

I have written a wrapper for LibSSH2 for Clarion, and while I have
been successful accessing Unix devices without any issue, I am having
issues accessing Juniper/Netscreen devices.
I am using LibSSH@ ver. 1.2.7 (windows binaries).
The steps I am following are:

1. Create a socket - no errors
2. Connect to the socket - no errors
3. Call libssh2_init (Flags set to 0) - no errors
4. Call libssh2_session_init_ex(0, 0, 0, 0) - no errors
5. Call libssh2_session_startup(session, socket) - no errors
I proceed through the authentication process without any errors.

Once I have authenticated, I attempt to open a channel shell as follows:
Session type is set to 'session',

    SELF.ChannelShell = PARENT.channel_open_ex(SELF.Session,
ADDRESS(SessionType), LEN(SessionType),
LIBSSH2_CHANNEL_WINDOW_DEFAULT, LIBSSH2_CHANNEL_PACKET_DEFAULT, 0, 0)

     IF SELF.ChannelShell = 0
        FunctionName = ' - (channel_open_ex)'
        BREAK
     END

     IF PARENT.channel_request_pty_ex(SELF.ChannelShell,
ADDRESS(STerm), LEN(STerm), 0, 0, TermWidth, TermHeight,
LIBSSH2_TERM_WIDTH_PX, LIBSSH2_TERM_HEIGHT_PX) <> 0
        FunctionName = ' - (channel_request_pty_ex)'
        BREAK
     END

This is where it is failing (attempting to obtain the pty. The error
code which we are getting is -22 -
LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED

Any ideas how to overcome this issue?
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-05-29

the libssh2 team