I mapped a user called user05 to sysadm_u SELinux login, and i set the boolean ssh_sysadm_login off.
But the user can still access via ssh.
[root@srv-rocky srv-admin]# getsebool ssh_sysadm_login
ssh_sysadm_login --> off
[root@srv-rocky srv-admin]# sudo semanage login -a -s sysadm_u user05
Login mapping for user05 is already defined, modifying instead
[root@srv-rocky srv-admin]# sudo semanage user -l | grep sysadm_u
sysadm_u user s0 s0-s0:c0.c1023 sysadm_r
[root@srv-rocky srv-admin]# semanage login -l
Login Name SELinux User MLS/MCS Range Service
__default__ unconfined_u s0 *
root unconfined_u s0-s0:c0.c1023 *
user05 sysadm_u s0-s0:c0.c1023 *
user06c staff_u s0-s0:c0.c1023 *
user07 staff_u s0-s0:c0.c1023 *
user08 guest_u s0 *
user10 user_u s0 *
piCO@pICO-MacBook ~ % ssh user05@192.168.1.107
user05@192.168.11.107's password:
Last login: Sat Jun 20 18:07:42 2026 from 192.168.1.104
[user05@srv-rocky ~]$ id -Z
sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023
Are you part of the OP’s team? Did turning the variable “on” result in the outcome you were seeking?
There aren’t many who are delving into the workings of selinux so you are as much the experts as any of the rest of us. So posting the results, good or bad, is useful information that may help others.
Apologies for the delay; I was unavailable over the last few days.
When the rule is set on, users mapped to the system_u SELinux user should be permitted to access the system via SSH. When the rule is set off, SSH access should be denied for those users.
In my tests last month I always had to set this boolean to on when I wanted to log in as a sysadm_u user. Can you tell us which version of Rocky Linux you’re using?
And a small correction, you probably meant “sysadm_u”, not “system_u” here:
I’ve been able to reproduce this issue on Rocky 10 and Alma 10. There is no issue on Rocky 9, 8 and CentOS 7. So I misremembered that I always had to set this boolean to log in, probably I got a failure on 2 different systems and then I just set the boolean on all the others.
There are some interesting differences in the SELinux denial entries between the OS versions but I’m not a SELinux expert and at the moment I don’t have the time to investigate further.
This is the full denial entry on Rocky 10 during SSH login (which succeeds anyway):
That’s true, these are the main differences. On Rocky 10 the domain is sshd_session_t and permissive is 1. On Rocky 9 the domain is sshd_t and permissive is 0. On Rocky 10:
Yes, it’s caused by the sshd_session_t domain being permissive on RHEL 10 and its derivatives. I thought that the semanage permissive commands could be used to change this configuration, but apparently it’s not possible. Quoting from man semanage-permissive:
Please note that this command can make any domain permissive, but can only remove the permissive property from domains where it was added by semanage permissive (“semanage permissive -d” can only be used on types listed as “Customized Permissive Types” by “semanage permissive -l”).
I tried to remove the sshd_session_t from the permissive liste but it fail the error bellow.
[root@srv-rocky srv-admin]# semanage permissive -d sshd_session_t
libsemanage.semanage_direct_remove_key: Unable to remove module permissive_sshd_session_t at priority 400. (No such file or directory).
FileNotFoundError: No such file or directory
[root@srv-rocky srv-admin]# semanage permissive -d sshd_auth_t
libsemanage.semanage_direct_remove_key: Unable to remove module permissive_sshd_auth_t at priority 400. (No such file or directory).
FileNotFoundError: No such file or directory
Of course, it’s just as the man page says. You can’t delete built-in permissive types. I think this change can only be made in the source code, it would require rebuilding SELinux RPM packages from source and it’s not easy to do. If you absolutely must have this rule enforced, I suggest installing Rocky Linux 9, not 10. Hopefully these new policies will be well-tested and set to enforcing by the time RHEL 11 is released.