# SELinux on Linux

Source: https://docs.neode.sk/getting-started/connect-a-client/selinux/
Last updated: 2026-12-01

> What to do when SELinux keeps people from connecting to a Linux computer with NeoDesk.

On distributions that turn SELinux on, such as Fedora, RHEL, Rocky Linux and
AlmaLinux, NeoDesk's Home says: **SELinux is turned on on this computer. It
may keep others from connecting with NeoDesk Desktop.** The card only says that
SELinux is on; its close button hides it for good. If people can't connect,
or they see no picture, check whether SELinux stopped NeoDesk.

## See whether SELinux blocked NeoDesk

List what SELinux refused NeoDesk recently:

```bash
sudo ausearch -m avc -ts recent -c neodesk
```

No entries: SELinux isn't the cause. To be sure, switch it to permissive mode
for one try, connect again, and switch it back on:

```bash
sudo setenforce 0
# connect to this computer again
sudo setenforce 1
```

## Allow what NeoDesk needs

When the list has entries, make a local policy module from them and load
it. `audit2allow` is in the package `policycoreutils-python-utils`.

```bash
sudo ausearch -m avc -c neodesk --raw | audit2allow -M neodesk-local
sudo semodule -i neodesk-local.pp
sudo systemctl restart neodesk
```

Read the rules in `neodesk-local.te` before you load the module: they allow
exactly what SELinux refused. To remove the module again:

```bash
sudo semodule -r neodesk-local
```
