当前位置:网站首页>File permissions of day02 operation
File permissions of day02 operation
2022-07-29 05:53:00 【Kun Kun fans】
1. Create user tom,jack,zhuzhuxia;zhuzhuxia The user's additional group is tom
sudo useradd tom
sudo useradd jack
sudo useradd zhuzhuxia -G tom
2. Switch to user tom, stay /tmp Create files in directory tom.txt ( Observe the ownership and authority of the file )
su tom
cd /tmp
touch tom.txt
ll /tmp/tom.txt
![]()
3. take tom The permission of the created file is modified to rw-r-----

Give first tom User command access
After use chmod Command to modify the permissions of the file
4. towards tom Write content in the created file "Tihs is tom file ,dont touch"

5. Excuse me, : jack,zhuzhuxia Can you check the contents of the file ?
![]()
![]()
Jack Belong to other users , Useless reading tom Permissions of files in users
zhuzhuxia and tom Is the same group of users , Can read tom Documents in
6. Create a directory /opt/test Catalog , The group of this directory is required to be it Group , Any user who creates files under this directory inherits the ownership of this directory Group ?
About chmod g+s
[[email protected] ~]# groupadd it
[[email protected] ~]# chmod 775 /opt/test
[[email protected] ~]# ll -d /opt/test/
drwxrwxr-x 3 root root 18 Jul 4 04:08 /opt/test/
[[email protected] ~]# chown .it /opt/test/
[[email protected] ~]# chmod g+s /opt/test/
[[email protected] ~]# su tom
[[email protected] root]$ sudo touch /opt/test/tom.txt
[sudo] password for tom:
[[email protected] root]$ ll /opt/test/tom.txt
-rw-r--r-- 1 root it 0 Jul 5 08:44 /opt/test/tom.txt
[[email protected] root]$ sudo touch /opt/test/jack.txt
[[email protected] root]$ ll /opt/test/jack.txt
-rw-r--r-- 1 root it 0 Jul 5 08:47 /opt/test/jack.txt
7. Use root Users create directories /prov, Change the owner to tom, Belongs to the group for tom, Permission is 750

Subject and group
ls -a

9. Check out your ip Address
ifconfig
or ip a
10.chown What is it used for ?chmod What is it used for ?
chown: Change the owner and group of the file or directory
chmod: Set access permissions for files or directories
边栏推荐
猜你喜欢

剑指核心-TaoCloud全闪SDS助力构建高性能云服务

焕然一新,swagger UI 主题更改

识变!应变!求变!

centos7 静默安装oracle

The Platonic metauniverse advocated by musk has long been verified by platofarm

Markdown语法
![30 knowledge points that must be mastered in quantitative development [what is level-2 data]](/img/cc/8eb2f0b11679af57e196f6e6d828f8.png)
30 knowledge points that must be mastered in quantitative development [what is level-2 data]

Common prompt pop-up box of uniapp

一文读懂Move2Earn项目——MOVE

"Shandong University mobile Internet development technology teaching website construction" project training log V
随机推荐
Huawei 2020 school recruitment written test programming questions read this article is enough (Part 1)
Move protocol global health declaration, carry out the health campaign to the end
识变!应变!求变!
数组的基础使用--遍历循环数组求出数组最大值,最小值以及最大值下标,最小值下标
Flink connector Oracle CDC 实时同步数据到MySQL(Oracle12c)
Plato farm is expected to further expand its ecosystem through elephant swap
Xsan is highly available - xdfs and San are integrated with new vitality
NIFI 改UTC时间为CST时间
Go|Gin 快速使用Swagger
SQL修复重复数据
Training log 6 of the project "construction of Shandong University mobile Internet development technology teaching website"
CMD window under Windows connects to MySQL and operates the table
Breaking through the hardware bottleneck (I): the development of Intel Architecture and bottleneck mining
How to make interesting apps for deep learning with zero code (suitable for novices)
XDFS&空天院HPC集群典型案例
如何在加密市场熊市中生存?
Dao race track is booming. What are the advantages of m-dao?
"Shandong University mobile Internet development technology teaching website construction" project training log V
30 knowledge points that must be mastered in quantitative development [what is level-2 data]
Laravel Swagger添加访问密码
https://blog.csdn.net/weixin_28419039/article/details/116607781