KEYUTILS(7)
โจ KEYUTILS โจ
okay bestie, so the manual name is keyutils and this is section 7 of the man pages โ it's giving "in-kernel key management utilities" and it's literally the front door to the whole keyutils situation ๐
๐ธ NAME ๐ธ
keyutils โ in-kernel key management utilities. yes that's the whole name. short. iconic. periodt.
๐ DESCRIPTION ๐
so the keyutils package is two things, and you need to know about both:
- a library, and
- a set of utilities
โฆand both of them exist so you can access the kernel's keyrings facility. that's the whole vibe. ๐๏ธโจ
There's a header file you get, and it hands you all the definitions and declarations you need to actually talk to the library:
#include <keyutils.h>
and when you're linking against the library, you gotta tell the linker this:
-lkeyutils
that's it. that's the link flag. don't forget it, bestie, or the linker will be like "who? never heard of her" ๐ญ
๐ฆ Three system calls, and yes you need all three
add_key(2)โ supplies a brand new key to the kernel. new key, who dis ๐request_key(2)โ goes looking for an existing key you can use, or, if you want, it'll make one for you when there's not one already there.keyctl(2)โ controls a key in a whole bunch of different ways. ok but listen: the library ships a variety of wrappers around this system call, and you should be using those wrappers, not calling it directly. like, fr fr. use the wrappers.
go read the add_key(2), request_key(2), and keyctl(2) manual pages if you want more, because there's more. ๐
and the keyctl() wrappers? they're all listed on the keyctl(3) manual page. that's where they live. ๐
๐ UTILITIES ๐
There's a program you get, and it lets you interact with the kernel facility through a bunch of subcommands. for example:
keyctl add user foo bar @s
look at her go. โจ
The keyctl(1) manual page has all the info on that program, so go there for the details.
๐ง the upcall thing (iykyk)
The kernel has this ability to upcall to userspace to fabricate new keys. ๐ณ
This can be triggered by request_key() โ but here's the tea: userspace is better off using add_key() instead if it possibly can. like, if you have the option, take the option. ๐
This upcalling mechanism is usually routed through the request-key(8) program. What that program does with any particular key is configurable, and the config lives here:
/etc/request-key.conf
/etc/request-key.d/
See the request-key.conf(5) and the request-key(8) manual pages for more information. ๐ซถ
๐ฅ SEE ALSO ๐ฅ
keyctl(1)keyctl(3)keyrings(7)persistent-keyring(7)process-keyring(7)session-keyring(7)thread-keyring(7)user-keyring(7)user-session-keyring(7)pam_keyinit(8)
okay that's the whole page, you ate it, you understood it, I'm so proud of you ๐
this one came from Linux, dated 21 Feb 2014 โ so go forth and manage those keys, bestie, you've got this ๐๐โจ
๐ฆ where this page comes from
- alpine 3.22: keyutils-doc 1.6.3-r4 ยท GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.23: keyutils-doc 1.6.3-r4 ยท GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.24: keyutils-doc 1.6.3-r4 ยท GPL-2.0-or-later AND LGPL-2.0-or-later
- arch rolling: keyutils 1.6.3-4 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: keyutils-libs 1.6.3-5.el10 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: keyutils-libs 1.6.3-1.el9 ยท GPLv2+ and LGPLv2+
- centos-stream 9: keyutils-libs 1.6.3-1.el9 ยท GPLv2+ and LGPLv2+
- debian bookworm: keyutils 1.6.3-2 ยท GPL-2.0-or-later
- debian trixie: keyutils 1.6.3-6 ยท GPL-2.0-or-later
- fedora 43: keyutils-libs 1.6.3-6.fc43 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: keyutils-libs 1.6.3-6.fc43 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs 1.6.3-7.fc44 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs 1.6.3-7.fc44 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: keyutils 1.6.3
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: keyutils 1.6.1-2ubuntu3 ยท GPL-2.0-or-later
- ubuntu noble: keyutils 1.6.3-3build1 ยท GPL-2.0-or-later
- ubuntu questing: keyutils 1.6.3-6ubuntu2
- ubuntu resolute: keyutils 1.6.3-6ubuntu3 ยท GPL-2.0-or-later
- ubuntu stonking: keyutils 1.6.3-6ubuntu3 ยท GPL-2.0-or-later
- Copyright (C) 2014 Red Hat, Inc. All Rights Reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms