info > chcon

πŸ“– NAME

chcon β€” Change SELinux security context of files

πŸš€ Quick Reference

Use CaseCommandDescription
Set a specific security contextchcon CONTEXT FILEπŸ“„ Assign the given CONTEXT to FILE
Copy context from a reference filechcon --reference=RFILE FILEπŸ“‹ Use RFILE's security context for FILE
Recursively change contextchcon -R CONTEXT DIRπŸ”„ Change context of all files under DIR
Set specific componentschcon -u USER -r ROLE -t TYPE -l RANGE FILEπŸ‘€πŸŽ­πŸ·οΈπŸ“ Set user, role, type, or range individually

πŸ“ SYNOPSIS

chcon [OPTION]... CONTEXT FILE...
chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...
chcon [OPTION]... --reference=RFILE FILE...

πŸ“„ DESCRIPTION

Change the SELinux security context of each FILE to CONTEXT. With --reference, change the security context of each FILE to that of RFILE.

Also see Common options.

βš™οΈ OPTIONS

πŸšͺ Exit Codes

An exit status of zero indicates success, and a nonzero value indicates failure.

chcon
πŸ“– NAME πŸš€ Quick Reference πŸ“ SYNOPSIS πŸ“„ DESCRIPTION βš™οΈ OPTIONS πŸšͺ Exit Codes

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 17:44 @216.73.216.199
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^