Interview Prep/Linux/Permissions, ownership, SELinux and mounts

After a package update, an app can't read its key: `Permission denied` on `/etc/pki/tls/private/app.key`, and the mode looks right.

AdvancedTroubleshootingPermissions, ownership, SELinux and mounts
Answer

Likely causes → SELinux label on the key is wrong (it was copied from elsewhere, admin_home_t), or a policy update tightened rules for that domain.

Diagnose →

ls -lZ /etc/pki/tls/private/app.key
matchpathcon /etc/pki/tls/private/app.key
sudo ausearch -m AVC -ts today -i | tail

Fix → sudo restorecon -v /etc/pki/tls/private/app.key. If the denial is for a custom domain, add a reviewed local policy module (audit2allow -M appkey).

Prevent → Place keys with install -m 600 -Z or run restorecon in the deploy step.

All Linux questions Roadmap: Linux

More on Permissions, ownership, SELinux and mounts