LinuxCommandLibrary

secon

Display SELinux security contexts

TLDR

Get current execution context

$ secon
copy
Get context of a process
$ secon --pid 1
copy
Get context of a file
$ secon --file path/to/file
copy
Get context of a symlink (don't resolve)
$ secon --link path/to/symlink
copy
Parse a context specification
$ secon system_u:system_r:container_t:s0
copy

SYNOPSIS

secon [options] [context]

DESCRIPTION

secon retrieves and displays SELinux security contexts. It can show the context of the current execution, processes, files, or parse context specifications.
Output includes user, role, type, and level components of the SELinux context.

PARAMETERS

--pid pid

Get context of specified process
--file path
Get context of file (follows symlinks)
--link path
Get context of symlink (don't follow)

CAVEATS

Requires SELinux to be enabled. File context may differ from actual access context.

HISTORY

Part of libselinux-utils, providing SELinux context inspection tools.

SEE ALSO

runcon(1), chcon(1), semanage(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community