HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

matchpathcon — Lookup the persistent SELinux security context setting of a path. See also: `semanage-fcontext`, `se

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandsecuritylookupclimatchpathconpersistentselinux
linux

Problem

How to use the matchpathcon command: Lookup the persistent SELinux security context setting of a path. See also: semanage-fcontext, secon, chcon, restorecon. More information: <https://manned.org/matchpathcon.8>.

Solution

matchpathcon — Lookup the persistent SELinux security context setting of a path. See also: semanage-fcontext, secon, chcon, restorecon. More information: <https://manned.org/matchpathcon.8>.

Lookup the persistent security context setting of an absolute path:
matchpathcon /{{path/to/file}}


Restrict lookup to settings on a specific file type:
matchpathcon -m {{file|dir|pipe|chr_file|blk_file|lnk_file|sock_file}} /{{path/to/file}}


[V]erify that the persistent and current security context of a path agree:
matchpathcon -V /{{path/to/file}}

Code Snippets

Lookup the persistent security context setting of an absolute path

matchpathcon /{{path/to/file}}

Restrict lookup to settings on a specific file type

matchpathcon -m {{file|dir|pipe|chr_file|blk_file|lnk_file|sock_file}} /{{path/to/file}}

[V]erify that the persistent and current security context of a path agree

matchpathcon -V /{{path/to/file}}

Context

tldr-pages: linux/matchpathcon

Revisions (0)

No revisions yet.