Linux chcon:修改文件安全上下文(security context)

博客介绍了Linux中`chcon`命令的用途,主要用于修改文件的安全上下文,该操作通常与SELinux相关。在安装特定软件如JDK7时,可能需要使用`chcon`来解决权限问题。
摘要由CSDN通过智能技术生成
[root@hadoop1 hadoop-2.7.2]# chcon --help
Usage: chcon [OPTION]... CONTEXT FILE...
  or:  chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...
  or:  chcon [OPTION]... --reference=RFILE FILE...
Change the security context of each FILE to CONTEXT.

  -c, --changes          like verbose but report only when a change is made
  -h, --no-dereference   affect symbolic links instead of any referenced file
                         (available only on systems with lchown system call)
  -f, --silent, --quiet  suppress most error messages
      --reference=RFILE  use RFILE's context instead of using a CONTEXT value
  -u, --user=USER        set user USER in the target security context
  -r, --role=ROLE        set role ROLE in the target security context
  -t, --type=TYPE        set type TYPE in the target security context
  -l, --range=RANGE      set range RANGE in the target security context
  -R, --recursive        ch
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值