LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

fixfiles

fix SELinux file security contexts

TLDR

Restore SELinux contexts for entire system
$ fixfiles restore
copy
Relabel filesystem on next boot
$ fixfiles onboot
copy
Force reset of customizable files
$ fixfiles -F restore
copy
Restore contexts for specific RPM packages
$ fixfiles -R package1,package2 restore
copy
Only process files created after date
$ fixfiles -N "2024-01-01" restore
copy
Verbose output
$ fixfiles -v restore
copy
Bind mount filesystems before relabeling
$ fixfiles -M restore
copy

SYNOPSIS

fixfiles [options] {restore|check|onboot|relabel|verify}

DESCRIPTION

fixfiles fixes file SELinux security contexts on the system. It is a wrapper script around restorecon and setfiles that provides convenient system-wide relabeling options.

PARAMETERS

-B

Record current date for later use with restore to speed up labeling
-F
Force reset of context for customizable files
-f
Clear /tmp directory without confirmation
-R PACKAGES
Discover files within specific RPM packages and restore their contexts
-C FILECONTEXT
Compare with previous filecontext and restore affected files
-N DATE
Only process files created after specified date (YYYY-MM-DD HH:MM)
-M
Bind mount filesystems before relabeling
-v
Verbose mode; run restorecon with -v instead of -p
restore
Restore file contexts to defaults
check
Check file contexts without changing them
onboot
Schedule relabeling on next boot
relabel
Relabel entire filesystem
verify
Verify file contexts match policy

CONFIGURATION

/etc/selinux/[policy]/contexts/files/file_contexts

Default SELinux file context rules defining security labels for paths.

INSTALL

sudo apt install policycoreutils
copy
sudo dnf install policycoreutils
copy
sudo zypper install policycoreutils
copy
nix profile install nixpkgs#policycoreutils
copy

CAVEATS

A full filesystem relabel can take significant time. Using -B with onboot then restore can speed up subsequent relabeling. Requires SELinux to be enabled.

HISTORY

fixfiles is part of the policycoreutils package, providing SELinux file context management utilities for Red Hat-based systems.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid