[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom banner


On 2/17/21 5:13 PM, tangying212 wrote:
Hello Andreas,
Uhm,
   Can you please share the solution/guide/instructions/setup to customize the banner before using the ssh_connect() function.I found the custombanner in the struct ssh_session->opt, but I don't know how to use it.please help me,thanks.

Hi,
it looks like libssh does not allow changing this in the client applications through API. That part of string is usually used by applications which can use it to detect various bugs or specification deviations (at least in case of OpenSSH, there is whole bunch of compat code). So unless you have really good reason to change it, I would try to avoid it.

The custombanner is used only in the server side of libssh and requires using private header file session.h to access the internal session variable session->opts.custombanner.

If there is a good reason to use different banner, I would suggest to update the function ssh_send_banner() in client.c to use the custombanner and update options.c to allow setting this through ssh_options_set(session, SSH_OPTIONS_CUSTOM_BANNER, "the banner").

Best regards,
--
Jakub Jelen
Senior Software Engineer
Crypto Team, Security Engineering
Red Hat, Inc.


References:
custom banner"tangying212" <tangying212@xxxxxx>
Archive administrator: postmaster@lists.cynapses.org