当前位置:网站首页>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
边栏推荐
- day02作业之进程管理
- Elastic box flex
- Huawei 2020 school recruitment written test programming questions read this article is enough (Part 1)
- xSAN高可用—XDFS与SAN融合焕发新生命力
- How to survive in the bear market of encryption market?
- 与张小姐的春夏秋冬(3)
- Strategic cooperation with many institutions shows the strength of the leading company of platofarm yuancosmos
- 与张小姐的春夏秋冬(4)
- Win10+opencv3.2+vs2015 configuration
- Move protocol global health declaration, carry out the health campaign to the end
猜你喜欢

『全闪实测』数据库加速解决方案

Crypto giants all in metauniverse, and platofarm may break through

Go|gin quickly use swagger

The bear market is slow, and bit.store provides stable stacking products to help you get through the bull and bear market

IDEA使用JDBC连接MySQL数据库个人详细教程

从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值

以‘智’提‘质|金融影像平台解决方案

From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run

Masscan tutorial

如何零代码制作深度学习的趣味app(适合新手)
随机推荐
华为2020校招笔试编程题 看这篇就够了(下)
如何在加密市场熊市中生存?
大部分PHP程序员,都搞不懂如何安全代码部署
与多家机构战略合作,背后彰显PlatoFarm元宇宙龙头的实力
与开源项目同步开发& CodeReview & Pull Request & fork怎么拉取原始仓库
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
JDBC连接数据库详细步骤
My ideal job, the absolute freedom of coder farmers is the most important - the pursuit of entrepreneurship in the future
Laravel service container (Application of context binding)
极致通缩和永动机模型,将推动 PlatoFarm 爆发
C# 判断用户是手机访问还是电脑访问
datax安装
超简单集成HMS ML Kit 实现parental control
Training log 7 of the project "construction of Shandong University mobile Internet development technology teaching website"
Mobile terminal -flex item attribute
剑指核心-TaoCloud全闪SDS助力构建高性能云服务
Starfish OS: create a new paradigm of the meta universe with reality as the link
Go|Gin 快速使用Swagger
Plato Farm有望通过Elephant Swap,进一步向外拓展生态
“山东大学移动互联网开发技术教学网站建设”项目实训日志二
https://blog.csdn.net/weixin_28419039/article/details/116607781