0

The Linux kernel's documentation on its Key Retention Service states that:

/proc/sys/kernel/keys/maxkeys /proc/sys/kernel/keys/maxbytes

These files hold the maximum number of keys that each non-root user may have and the maximum total number of bytes of data that each of those users may have stored in their keys.

Though, I find, the wording isn't clear on whether it is per user or per key ´maxbytes´ can be used to store key data. So is it per user or per key?

1

The answer is: Per user.

See the demonstration below:

┌[rovanion][RiggenBuntu]:~
└$ keyctl add user a-key some-data @u
812046028

┌[root][RiggenBuntu]:/
└# cat /proc/key-users
    0:    95 94/94 83/1000000 1687/25000000
 1000:     5 5/5 5/200 61/20000
┌[root][RiggenBuntu]:/
└# sysctl -w kernel.keys.maxbytes=62
kernel.keys.maxbytes = 62
┌[root][RiggenBuntu]:/
└# cat /proc/key-users
    0:    95 94/94 83/1000000 1687/25000000
 1000:     5 5/5 5/200 61/62

┌[rovanion][RiggenBuntu]:~
└$ keyctl add user b-key more-data @u
add_key: Disk quota exceeded

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.