Все команды протестированы в Raspberry Pi 3 с Raspbian OS. keyctl из keyutils-1.6.1 (Построен 2020-03-25). Linux raspberrypi 4.19.108-v7 +.
Сначала я запускаю следующую команду в LXTerminal (CTRL + ALT + T):
pi@raspberrypi:~ $ dd if=/dev/urandom bs=1 count=32 status=none | keyctl padd user kmk-user @u
pi@raspberrypi:~ $ keyctl show @s
Keyring
711830815 --alswrv 0 0 keyring: _ses
689584228 ----s-rv 0 0 \_ user: invocation_id
pi@raspberrypi:~ $ keyctl show @u
Keyring
142645230 --alswrv 1000 65534 keyring: _uid.1000
170877083 --alswrv 1000 1000 \_ user: kmk-user
pi@raspberrypi:~ $ sudo cat /proc/keys
02223a7e I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
02e2fd7a I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
03137436 I--Q--- 10 perm 3f030000 0 0 keyring _ses: 1
03c45b9a I--Q--- 6 perm 3f030000 0 0 keyring _ses: 1
043a718f I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
04855c3e I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
06c8d5ce I--Q--- 1 perm 1f3f0000 0 65534 keyring _uid_ses.0: 1
07dae18e I------ 1 perm 1f0f0000 0 0 keyring .evm: empty
0a1c9f48 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
0a940c2a I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
0b5947e4 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
0c83497b I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
102c5f8b I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
1118e26c I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
13a9715d I------ 1 perm 1f0b0000 0 0 keyring .builtin_regdb_keys: 1
17363ba9 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
1852c597 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
18e604fd I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
1a9930b2 I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
1bf02ecc I------ 1 perm 1f030000 0 0 asymmetri sforshee: 00b28ddf47aef9cea7: X509.rsa []
1cbdf5d8 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
1d233ce9 I------ 1 perm 1f030000 0 0 asymmetri ubuntu: wenxinleong signing key: dd43951113bd9ec66ddb6ad015eff35ee35a8f86: X509.rsa e35a8f86 []
1d383e5a I------ 1 perm 1f030000 0 0 keyring .dns_resolver: empty
1da9b1f1 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
1e534ab8 I------ 1 perm 1f030000 0 0 keyring .id_resolver: empty
1e5dd4c7 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
1e776974 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
284217fa I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
289e20f2 I------ 1 perm 1f030000 0 0 asymmetri IMA-CA: IMA/EVM certificate signing key: 3b8cf3d4f9513632582ad63be7decf9309c225cd: X509.rsa 09c225cd []
28d21b03 I------ 1 perm 1f0f0000 0 0 keyring .ima: 1
291a3864 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
295e58d1 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
29b44fb0 I--Q--- 2 perm 1f3f0000 0 65534 keyring _uid.0: empty
29e4eaed I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
2a6dad1f I--Q--- 72 perm 3f030000 0 0 keyring _ses: 1
2b2743a6 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
2dd82fe5 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
2ee89ece I--Q--- 1 perm 3f030000 0 0 keyring _ses: 1
321d5477 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
33876f00 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
347e4a12 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
35ae3569 I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
36182ec8 I------ 1 perm 1f0b0000 0 0 keyring .builtin_trusted_keys: 1
36a71fe9 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
372bbf0d I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
39306e49 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
3995d96e I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
39f0e35d I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
3b16bd06 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
3da6e172 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
3e2beeb6 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
3e3050f0 I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
3ea1d4f3 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
Затем следующую команду в tty1 (CTRL + ALT +) F1)
pi@raspberrypi:~ $ dd if=/dev/urandom bs=1 count=32 status=none | keyctl padd user kmk-user1 @u
pi@raspberrypi:~ $ keyctl show @s
Keyring
759741276 --alswrv 1000 1000 keyring: _ses
142645230 --alswrv 1000 65534 \_ keyring: _uid.1000
963002826 --alswrv 1000 1000 \_ user: kmk-user1
170877083 --alswrv 1000 1000 \_ user: kmk-user
pi@raspberrypi:~ $ keyctl show @u
Keyring
142645230 --alswrv 1000 65534 keyring: _uid.1000
963002826 --alswrv 1000 1000 \_ user: kmk-user1
170877083 --alswrv 1000 1000 \_ user: kmk-user
pi@raspberrypi:~ $ sudo cat /proc/keys
02223a7e I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
02e2fd7a I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
03137436 I--Q--- 6 perm 3f030000 0 0 keyring _ses: 1
03c45b9a I--Q--- 6 perm 3f030000 0 0 keyring _ses: 1
043a718f I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
04855c3e I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
06c8d5ce I--Q--- 1 perm 1f3f0000 0 65534 keyring _uid_ses.0: 1
07dae18e I------ 1 perm 1f0f0000 0 0 keyring .evm: empty
088097ee I--Q--- 3 perm 1f3f0000 1000 65534 keyring _uid.1000: 2
0a1c9f48 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
0a2f609b I--Q--- 1 perm 3f010000 1000 1000 user kmk-user: 32
0a940c2a I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
0b5947e4 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
0c83497b I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
102c5f8b I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
1118e26c I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
13a9715d I------ 1 perm 1f0b0000 0 0 keyring .builtin_regdb_keys: 1
17363ba9 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
1852c597 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
18e604fd I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
1a9930b2 I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
1bf02ecc I------ 1 perm 1f030000 0 0 asymmetri sforshee: 00b28ddf47aef9cea7: X509.rsa []
1cbdf5d8 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
1d233ce9 I------ 1 perm 1f030000 0 0 asymmetri ubuntu: wenxinleong signing key: dd43951113bd9ec66ddb6ad015eff35ee35a8f86: X509.rsa e35a8f86 []
1d383e5a I------ 1 perm 1f030000 0 0 keyring .dns_resolver: empty
1da9b1f1 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
1e534ab8 I------ 1 perm 1f030000 0 0 keyring .id_resolver: empty
1e5dd4c7 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
1e776974 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
284217fa I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
289e20f2 I------ 1 perm 1f030000 0 0 asymmetri IMA-CA: IMA/EVM certificate signing key: 3b8cf3d4f9513632582ad63be7decf9309c225cd: X509.rsa 09c225cd []
28d21b03 I------ 1 perm 1f0f0000 0 0 keyring .ima: 1
291a3864 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
295e58d1 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
29b44fb0 I--Q--- 2 perm 1f3f0000 0 65534 keyring _uid.0: empty
29e4eaed I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
2a6dad1f I--Q--- 53 perm 3f030000 0 0 keyring _ses: 1
2b2743a6 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
2d48bb5c I--Q--- 25 perm 3f030000 1000 1000 keyring _ses: 1
2dd82fe5 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
2ee89ece I--Q--- 1 perm 3f030000 0 0 keyring _ses: 1
321d5477 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
33876f00 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
347e4a12 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
35ae3569 I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
36182ec8 I------ 1 perm 1f0b0000 0 0 keyring .builtin_trusted_keys: 1
36a71fe9 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
372bbf0d I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
39306e49 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
396641ca I--Q--- 1 perm 3f010000 1000 1000 user kmk-user1: 32
3995d96e I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
39f0e35d I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
3b16bd06 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
3da6e172 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
3e2beeb6 I--Q--- 1 perm 0b0b0000 0 0 user invocation_id: 16
3e3050f0 I--Q--- 3 perm 3f030000 0 0 keyring _ses: 1
3ea1d4f3 I--Q--- 2 perm 3f030000 0 0 keyring _ses: 1
Почему sudo cat /proc/keys
в LXTerminal показывает только элементы с uid: 0. А в tty1 все пользователи показываются?