当前位置:网站首页>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边栏推荐
- Graduation summary
- leetcode刷题:二叉树04(二叉树的层序遍历)
- 干货!基于GAN的稀有样本生成
- Idea configuration 360zip open by default -- external tools
- The maximum expiration time of client secret in azure ad application registration is modified to 2 years
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡
- 02 ls 命令的具体实现
- pytest多进程/多线程执行测试用例
- Go 语言入门很简单:Go 实现凯撒密码
猜你喜欢

Rhcsa-- day one

用于TCP协议交互的TCPClientDemo

Perf simple process for multithreaded profile

I Build a simple microservice project

深度优先搜索简要讲解(附带基础题)

ctf-pikachu-CSRF

Reduce function under functools

leetcode刷题:二叉树07(二叉树的最大深度)

【微服务|openfeign】@FeignClient详解

Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
随机推荐
Myslq delete followed by limit
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
Unity draws the trajectory of pinball and billiards
JDBC advanced
Perf simple process for multithreaded profile
vim正确加区间注释
还原窗口位置的微妙之处
The difference between bagging and boosting in machine learning
Flink learning 6: programming model
C语言双向链表初版
Msgraphmailbag - search only driveitems of file types
vim映射命令
Smart subway | cloud computing injects wisdom into urban subway transportation
三年进账35.31亿,这个江西老表要IPO了
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
*. No main manifest attribute in jar
如何有效远程办公之我见 | 社区征文
pytest多进程/多线程执行测试用例
【微服务|openfeign】@FeignClient详解
Evolution of MySQL database architecture