ssh_server_key_api(3)
β¨ ssh_server_key_api β¨
okay bestie, so this one's a manual page from the Erlang crew β it's ssh_server_key_api, and yeah, it's that kind of page, the Erlang Module Definition kind. don't panic, it's actually short and adorable. let's get into it π
πΈ NAME πΈ
ssh_server_key_api - -behaviour(ssh_server_key_api).
periodt. that's the whole flex. it's a behaviour. π
π¦ DESCRIPTION π¦
so, lowkey the whole vibe here is that this is a behaviour β and it describes the API for public key handling of an SSH server. like, it's the blueprint, the little contract, the main character moment for how your server deals with keys. π
and here's the slay: by implementing the callbacks defined in this behaviour, the public key handling of an SSH server can be customized. yes, you get to do that. go off. π
but ngl, if you just want the default? by default the SSH application implements this behaviour with help of the standard OpenSSH files β see the ssh application manual for the deets. β¨
π DATA TYPES π
no cap, there's exactly one, and she's a little nested-looking one:
daemon_key_cb_options(T) ::
[{key_cb_private, [T]} | ssh:daemon_option()].
what even is this? it's the options provided to ssh:daemon/2,3. π«Ά
also important, don't skip this: the option list you gave in the key_cb option is available with the key key_cb_private. iykyk β that's how you reach in and grab your own stuff back. π
π§ CALLBACKS π§
okay these are the two little functions your implementation has to bring to the group chat. π―
β host_key(Algorithm, DaemonOptions)
fetches the private key of the host. that's it. that's the job. no notes. π
β is_auth_key(PublicKey, User, DaemonOptions)
checks if the user key is authorized. yes bestie, this is the bouncer at the door. π
just a lil reminder boo: both of these are callbacks, so you're implementing them, not calling them yourself. the SSH server handles that part. π
aaaaand that's the whole page, you ate it. ππ
big kisses to Ericsson AB for this one β it ships with ssh 6.0.5, and yes it's ssh_server_key_api(3). drink some water, then go customize your key handling. π¦β¨
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms