libssh2_session_banner_set(3)
β¨ libssh2_session_banner_set β¨
okay so bestie, we're in the libssh2 manual, and today's main character is libssh2_session_banner_set(3) β the little function that lets you pick the SSH protocol banner your local client sends out into the world. π
π NAME π
libssh2_session_banner_set β set the SSH protocol banner for the local client. yes that's it. that's the whole job. and she does it flawlessly. π
πΈ SYNOPSIS πΈ
#include <libssh2.h>
int
libssh2_session_banner_set(LIBSSH2_SESSION *session, const char *banner);
π DESCRIPTION π
okay so, two things you're handing over:
sessionβ the Session instance, as returned bylibssh2_session_init_ex(3). your whole vibe container fr.bannerβ a pointer to a zero-terminated string holding the user defined banner. so like, your string. cute, custom, yours. π¦
and what does she do with it?? she sets the banner that will be sent to the remote host when the SSH session is started with libssh2_session_handshake(3). that's the moment it goes out into the world. β¨
now β this is optional, okay? nobody's forcing you. if you don't call this, a banner corresponding to the protocol and libssh2 version will be sent by default. so she has a default fit already picked out; this function is just for when you wanna dress her up yourself. π
β RETURN VALUE β
Returns 0 on success or negative on failure. and if it would otherwise block? it returns LIBSSH2_ERROR_EAGAIN. π«
now listen, and this is important: while LIBSSH2_ERROR_EAGAIN is a negative number, it is not really a failure per se. it's giving "not right now bestie, try again later," not "everything is on fire." don't panic. π
π ERRORS π
LIBSSH2_ERROR_ALLOCβ An internal memory allocation call failed. the malloc said no. π
π AVAILABILITY π
Added in 1.4.0. π
and lowkey a glow-up moment: before 1.4.0 this function was known as libssh2_banner_set(3). she rebranded. iconic behavior honestly. π
π§ SEE ALSO π§
that's the whole page, bestie, no notes, no cap. this was libssh2, dated 9 Sep 2011 β and if you got this far, you're officially a banner-setting legend. go set a banner. make it weird. π«Άπβ¨πΈπ¦
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms