Subject: Re: Help with the user authentication banner.

Re: Help with the user authentication banner.

From: Salvador Fandiņo <>
Date: Tue, 22 Oct 2013 12:02:01 +0200

On 10/21/2013 07:31 PM, paul parker wrote:
> Hello,
> I'm new to libssh2 and was hoping I could get some help regarding
> receiving the user authentication banner.
> I have an ssh server with a banner enabled and configured in
> /etc/ <> - however I am not sure how to
> retrieve this banner via libssh2? I've read through the API reference,
> and I cannot find any methods regarding this.
> I have a fully functional ssh implementation set up other than this, but
> I cannot seem to find any documentation regarding this banner/welcome
> message.

grep'ing over libssh2 code for SSH_MSG_USERAUTH_BANNER reveals that
authentication banners are not currently handled by the library.

> I'm beginning to think that this is something that should be implemented
> by my own socket implementation rather than libssh2; hopefully someone
> can point me in the right direction.

You can't do it that way as the authentication banner is transferred
over the encrypted connection.

The right way to do that is probably to add code to handle msgs pf type
SSH_MSG_USERAUTH_BANNER into the _libssh2_packet_add function, in
packet.c. It may store the banner data in some internal variable or
invoke some callback, etc.

Received on 2013-10-22