当前位置:网站首页>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
边栏推荐
猜你喜欢

ThinkPHP6 输出二维码图片格式 解决与 Debug 的冲突

浅谈分布式全闪存储自动化测试平台设计

The LAAS protocol of defi 2.0 is the key to revitalizing the development of defi track

JDBC连接数据库详细步骤

DAO赛道异军突起,M-DAO的优势在哪里?

识变!应变!求变!

华为2020校招笔试编程题 看这篇就够了(下)

“山东大学移动互联网开发技术教学网站建设”项目实训日志五

如何零代码制作深度学习的趣味app(适合新手)

改哭了,终于解决了Cannot read properties of undefined (reading ‘parseComponent‘)
随机推荐
Changed crying, and finally solved cannot read properties of undefined (reading 'parsecomponent')
xSAN高可用—XDFS与SAN融合焕发新生命力
Elastic box flex
SQL修复重复数据
Seay source code audit system
From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
我的理想工作,码农的绝对自由支配才是最重要的——未来创业的追求
Laravel service container (Application of context binding)
Move protocol global health declaration, carry out the health campaign to the end
Training log II of the project "construction of Shandong University mobile Internet development technology teaching website"
华为2020校招笔试编程题 看这篇就够了(上)
Countdown of the uniapp component (such as the countdown to reading the agreement and the countdown to completing learning)
如何零代码制作深度学习的趣味app(适合新手)
运动健康深入人心,MOVE PROTOCOL引领品质生活
从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值
与张小姐的春夏秋冬(1)
iSCSI vs iSER vs NVMe-TCP vs NVMe-RDMA
DAY4:MySQL 数据库的建立及简单实用
Breaking through the hardware bottleneck (I): the development of Intel Architecture and bottleneck mining
Super simple integration of HMS ml kit to realize parent control
https://blog.csdn.net/weixin_28419039/article/details/116607781