View previous topic :: View next topic |
Author |
Message |
Torpus Apprentice


Joined: 20 Aug 2023 Posts: 184
|
Posted: Sun Oct 15, 2023 8:08 am Post subject: [SOLVED] How can I enable SELinux on the kernel?? |
|
|
Code: | [linux] login tp 9:02:36
Password:
Last login: Sun Oct 15 08:54:40 CET 2023 on pts/0
[~] id -Z 9:04:05
id: --context (-Z) works only on an SELinux-enabled kernel
[~] newrole -r sysadm_r 9:04:12
Sorry, newrole may be used only on a SELinux kernel. |
I followed everything on this [code=https://wiki.gentoo.org/wiki/SELinux/Installation]guide[/code] but SELinux doesn't work... (except for relabeling some packages)
I have these already:
Code: | CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9
CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256 |
Here's my full .config
Anybody knows what's going on? _________________ Illegitimi non carborundum.
Last edited by Torpus on Sun Oct 15, 2023 11:08 am; edited 1 time in total |
|
Back to top |
|
 |
alamahant Advocate

Joined: 23 Mar 2019 Posts: 3961
|
Posted: Sun Oct 15, 2023 9:28 am Post subject: |
|
|
Use
Code: |
security=selinux selinux=1
|
or newer
Code: |
lsm=selinux selinux=1
|
as kernel boot parameters.
Maybe via grub
Code: |
GRUB_CMDLINE_LINUX="..................... lsm=selinux selinux=1"
|
and update grub. _________________
 |
|
Back to top |
|
 |
Torpus Apprentice


Joined: 20 Aug 2023 Posts: 184
|
Posted: Sun Oct 15, 2023 10:42 am Post subject: |
|
|
alamahant,
I did that already (except for updating GRUB, despite that it didn't work).
I'm on chroot BTW, does that matter as the kernel is technically not used? _________________ Illegitimi non carborundum. |
|
Back to top |
|
 |
alamahant Advocate

Joined: 23 Mar 2019 Posts: 3961
|
Posted: Sun Oct 15, 2023 10:46 am Post subject: |
|
|
Yes.
Selinux does not work in chroot.
What is more if you make changes to your selinux system in a chroot, you will need to relabel files after booting.
https://wiki.gentoo.org/wiki/SELinux/Installation#Relabel
Just exit the chroot and boot into your selinux Gentoo and see if it works. _________________
 |
|
Back to top |
|
 |
Torpus Apprentice


Joined: 20 Aug 2023 Posts: 184
|
Posted: Sun Oct 15, 2023 11:08 am Post subject: |
|
|
Ahh  _________________ Illegitimi non carborundum. |
|
Back to top |
|
 |
|