Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed introduction of the chcon command

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "detailed introduction of chcon command". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

chcon command: modifies the security context of an object (file). For example: user: role: type: security level.

Command Format:

Chcon [OPTIONS…] CONTEXT FILES…..

Chcon [OPTIONS…] -reference=PEF_FILES FILES…

Description:

CONTEXT is the security context to set

FILES object (file)

--reference object referenced

PEF_FILES Reference File Context

FILES Apply the reference file context as my context.

OPTIONS are as follows:

-f enforce

-R Recursively modify the security context of an object

-r ROLE Modify the configuration of security context roles

-t TYPE Modify the configuration of security context types

-u USER modifies the configuration of the security context user

-v Display lengthy messages

-l, --range=RANGE Modify the security level in a security context

Example:

1、ftp

//If you want to share files anonymously

chcon -R -t public_content_t /var/ftp

//If you want to setup a directory where you can upload files

chcon -t public_content_rw_t /var/ftp/incoming

//You must also turn on the boolean allow_ftpd_anon_write

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report