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

A service fails to bind to a custom port: `bind() to 0.0.0.0:8888 failed (13: Permission denied)` while running as root.

IntermediateTroubleshootingPermissions, ownership, SELinux and mounts
Answer

Likely causes → SELinux only allows the service's domain to bind ports with specific labels.

Diagnose →

sudo ausearch -m AVC -ts recent | grep name_bind
sudo semanage port -l | grep -w 8888

Fix → sudo semanage port -a -t http_port_t -p tcp 8888 (use the type matching the service), then restart.

Prevent → Prefer standard ports or label custom ones in automation.

All Linux questions Roadmap: Linux

More on Permissions, ownership, SELinux and mounts