SECON(1)
π SECON β bestie, let's go look at an SELinux context π
okay so this is secon, a manual page from the General Commands Manual squad, and it does exactly one thing but it does it beautifully: it shows you an SELinux context, and it can grab that context from a file, a program, or from you, the user. π
β¨ SYNOPSIS β¨
secon [-hVurtscmPRfLp] [CONTEXT]
[--file] FILE
[--link] FILE
[--pid] PID
πΈ DESCRIPTION πΈ
So like. A context is a whole vibe, right? And secon lets you see a part of a context. π«Ά The context gets taken from a file, a pid, your own user input, or β plot twist β from the context that secon itself was originally executed in. main character energy fr.
Here's the full menu of flags, no skips, no cap:
-V,--versionβ shows the current version ofsecon-h,--helpβ shows the usage information forsecon-P,--promptβ outputs data in a format suitable for a prompt-C,--colorβ outputs data with the associated ANSI color codes (this one requires-P, just so you know π )-u,--userβ show the user of the security context-r,--roleβ show the role of the security context-t,--typeβ show the type of the security context-s,--sensitivityβ show the sensitivity level of the security context-c,--clearanceβ show the clearance level of the security context-m,--mls-rangeβ show the sensitivity level and clearance, as a range, of the security context-R,--rawβ outputs the sensitivity level and clearance in an untranslated format.-f,--fileβ gets the context from the specified file FILE-L,--linkβ gets the context from the specified file FILE (and no, it doesn't follow symlinks π«π)-p,--pidβ gets the context from the specified process PID--pid-execβ gets the exec context from the specified process PID--pid-fsβ gets the fscreate context from the specified process PID--pid-keyβ gets the key context from the specified process PID--current,--selfβ gets the context from the current process--current-exec,--self-execβ gets the exec context from the current process--current-fs,--self-fsβ gets the fscreate context from the current process--current-key,--self-keyβ gets the key context from the current process--parentβ gets the context from the parent of the current process--parent-execβ gets the exec context from the parent of the current process--parent-fsβ gets the fscreate context from the parent of the current process--parent-keyβ gets the key context from the parent of the current process
Now, the extra argument CONTEXT? You may hand it over, and it gets used if no options have been specified to make secon pull its context from another source. π
And if that argument is -, then the context will be read from stdin. π
If there's no argument at all, secon will try reading a context from stdin β but only if that stdin is not a tty. If it is a tty, then secon acts as though --self had been passed. iconic behaviour honestly.
Heads up bestie: if none of--user,--role,--type,--levelor--mls-rangeis passed. Then all of them will be output. π (yes, all of them, every single one, we're going full send)
π EXAMPLE π
Show SElinux context of the init process
# secon --pid 1
Parse the type portion of given security context
# secon -t system_u:object_r:httpd_sys_rw_content_t:s0
π₯ SEE ALSO π₯
π AUTHORS π
- James Antill (
james.antill@redhat.com)
and that's the whole page, bestie!! this one comes to you from Security Enhanced Linux, dated April 2006, and it's SECON(1) the whole way down. go forth and inspect some contexts, you absolute legend ππ¦β¨
π¦ where this page comes from
- centos-stream 10: policycoreutils 3.11-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: policycoreutils 3.6-9.el9 Β· GPL-2.0-or-later
- debian trixie: policycoreutils 3.8.1-2
- fedora 43: policycoreutils 3.9-5.fc43 Β· GPL-2.0-or-later
- fedora 43: policycoreutils 3.9-7.fc43 Β· GPL-2.0-or-later
- fedora 44: policycoreutils 3.10-1.fc44 Β· GPL-2.0-or-later
- fedora 44: policycoreutils 3.11-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: policycoreutils 3.11
- nixpkgs unstable: policycoreutils 3.11
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- ubuntu questing: policycoreutils 3.8.1-1
- ubuntu resolute: policycoreutils 3.9-2
- ubuntu stonking: policycoreutils 3.11-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms