Permissions and owners

The semanage command

Manages SELinux settings: ports and file contexts.

Syntax

semanage [port -l | fcontext -a -t tipo ruta]

Most useful options

port -lLists port types
fcontextManages file contexts

Copy-ready examples

$ semanage port -lShow port types
$ sudo semanage fcontext -a -t httpd_sys_content_t /var/wwwLabel a path

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • After changing fcontext you must apply it with restorecon.

FAQ

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course