当前位置:网站首页>RHCSA 03 - 文件的基础权限
RHCSA 03 - 文件的基础权限
2022-07-04 03:51:00 【王万林 Ben】
前言
Linux的UGO权限模型,可以满足日常的权限需求。
什么是UGO权限模型?
实践
步骤1:创建用户,并将用户加入新创建的群组
[[email protected] ~]# groupadd students
[[email protected] ~]# groupadd profs
[[email protected] ~]# useradd linda -G students
useradd lisa -G students
[[email protected] ~]# useradd lisa -G students
useradd anouk -G profs
[[email protected] ~]# useradd anouk -G profs
useradd anna -G profs
[[email protected] ~]# useradd anna -G profs
[[email protected] ~]# 步骤2:创建两个文件夹/data/students与/data/profs
[[email protected] ~]# mkdir -p /data/students /data/profs
[[email protected] ~]# ls -l /data
total 0
drwxr-xr-x. 2 root root 6 Jul 2 01:47 profs
drwxr-xr-x. 2 root root 6 Jul 2 01:47 students步骤3:将刚创建的文件夹,分别更改群组为students, profs,权限为770
[[email protected] ~]# chgrp students /data/students
[[email protected] ~]# chgrp profs /data/profs
[[email protected] ~]# chmod 770 /data/{students,profs}
[[email protected] ~]# ls -l /data
total 0
drwxrwx---. 2 root profs 6 Jul 2 01:47 profs
drwxrwx---. 2 root students 6 Jul 2 01:47 students步骤4:验证:anna成功往/data/profs创建文件,anouk无法写属主为anna权限为644的文件。
[[email protected] ~]# id anna
uid=1004(anna) gid=1006(anna) groups=1006(anna),1002(profs)
[[email protected] ~]# su anna -c "touch /data/profs/anna"
[[email protected] ~]# ls -l /data/profs/anna
-rw-r--r--. 1 anna anna 0 Jul 2 01:58 /data/profs/anna
[[email protected] ~]# su anouk -c "echo anouk > /data/profs/anna"
bash: /data/profs/anna: Permission denied边栏推荐
- Pointer array and array pointer
- Storage of MySQL database
- Select sorting and bubble sorting template
- Katalon uses script to query list size
- 【微服务|openfeign】feign的两种降级方式|Fallback|FallbackFactory
- Unity draws the trajectory of pinball and billiards
- [csrf-01] basic principle and attack and defense of Cross Site Request Forgery vulnerability
- Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡
- VIM mapping command
- Programmers' telecommuting is mixed | community essay solicitation
猜你喜欢

三年进账35.31亿,这个江西老表要IPO了

用于TCP协议交互的TCPClientDemo

leetcode刷题:二叉树09(二叉树的最小深度)
![[Logitech] m720](/img/bb/44144a1c3907808398c05b3b36962c.png)
[Logitech] m720

Storage of MySQL database

Illustrated network: what is the hot backup router protocol HSRP?

postgresql 用户不能自己创建表格配置

Reduce function under functools

三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量

函数计算异步任务能力介绍 - 任务触发去重
随机推荐
Redis cluster view the slots of each node
Deep thinking on investment
线程常用的方法
leetcode刷题:二叉树06(对称二叉树)
Simple dialogue system -- text classification using transformer
Distributed system: what, why, how
三年进账35.31亿,这个江西老表要IPO了
Graduation project: design seckill e-commerce system
Smart subway | cloud computing injects wisdom into urban subway transportation
01 qemu 启动编译好的镜像 VFS: Unable to mount root fs on unknown-block(0,0)
软件测试是干什么的 发现缺陷错误,提高软件的质量
leetcode刷题:二叉树08(N叉树的最大深度)
"Implement both software and hardware" to help build a new cloud computing data center
SDP中的SPA
Katalon framework tests web (XXI) to obtain element attribute assertions
思考的小记录
I Build a simple microservice project
Illustrated network: what is the hot backup router protocol HSRP?
程序员远程办公喜忧参半| 社区征文
How to telecommute more efficiently | community essay solicitation