semanage Verified for current stable LTS

Semanage Command: Add User Defined File Context Labeling Rule

Use for add user defined file context labeling rule with Semanage. Exact CLI syntax to add user defined file context labeling rule using Semanage.

When to use this: Use for add user defined file context labeling rule with Semanage.

Command Syntax

sudo semanage fcontext -a -t <samba_share_t> '/mnt/share(/.*)?'

Live Command Builder

Final Command

sudo semanage fcontext -a -t <samba_share_t> '/mnt/share(/.*)?'

Command Breakdown

-a
Command Option
Tool-specific option used by this command invocation.
-t
Command Option
Tool-specific option used by this command invocation.

FAQ

Purpose: Exact syntax to add user defined file context labeling rule using Semanage.

Test path: Replace placeholders and run destructive commands in a disposable workspace first.

Flag behavior: Tool version, platform, and shell can change behavior.

Improve This Command

Suggest a correction, safer default, or version-specific note for this entry.

Related Operations

Back to Semanage directory