Why use `restorecon` instead of `chcon`?
IntermediateProductionFirewalls, MAC & Compliance
Answer
chcon changes a label directly, but the change is lost on the next relabel (restorecon, fixfiles, or a full /.autorelabel). The persistent approach is to define the rule in policy with semanage fcontext -a and then apply it with restorecon. Files moved with mv keep their original label (copies get the destination's default), a classic cause of AVC denials.
More on Firewalls, MAC & Compliance
How do ufw, firewalld, nftables and iptables relate?BeginnerConfigure ufw for a web server with SSH only from the office.BeginnerExplain firewalld zones and runtime vs permanent configuration.IntermediateWrite a minimal nftables ruleset for a server.AdvancedWhy are nftables preferred over iptables at scale?AdvancedHow do you avoid locking yourself out when changing remote firewall rules?Intermediate