当前位置:网站首页>Quickly learn to use file permissions
Quickly learn to use file permissions
2022-07-23 23:16:00 【I'm Zha Zha Hui】
List of articles
- 4 create a file , And give authority 611( Two ways , A kind of guoa, A kind of nnn)
- 5. Create directory , And give authority 755( Two ways , A kind of guoa, A kind of nnn)
- 6. create a file , And modify the owner and group of the file to other users
- 7. Set up suid, Set for file suid( Two ways u+s and nnnn) The way
- 8. Set up sgid, Set for file sgid( Two ways g+s and nnnn) The way
- 9. Set up sbit, Set for directory sbit( Two ways o+t and nnnn) The way
- 10. create a file , Query file acl
4 create a file , And give authority 611( Two ways , A kind of guoa, A kind of nnn)
[[email protected] ~]# touch file1
[[email protected] ~]# ls -l file1
-rw-r--r-- 1 root root 0 Jul 21 20:45 file1
[[email protected] ~]# chmod 000 file
[[email protected] ~]# chmod u+r,w g+x o+x file
chmod: invalid mode: ‘u+r,w’
Try 'chmod --help' for more information.
[[email protected] ~]# chmod u+rw g+x o+x file
chmod: cannot access 'g+x': No such file or directory
chmod: cannot access 'o+x': No such file or directory
[[email protected] ~]# chmod u+rw,g+x,o+x file
[[email protected] ~]# ll file
-rw---x--x 1 root root 13 Jul 20 10:59 file
5. Create directory , And give authority 755( Two ways , A kind of guoa, A kind of nnn)
[[email protected] ~]# mkdir file1
mkdir: cannot create directory ‘file1’: File exists
[[email protected] ~]# mkdir file3
[[email protected] ~]# chmod 755 file3
[[email protected] ~]# ls -l file3
total 0
[[email protected] ~]# ls -ld file3
drwxr-xr-x 2 root root 4096 Jul 22 00:02 file3
[[email protected] ~]#
6. create a file , And modify the owner and group of the file to other users
[[email protected] ~]# ls /home
user1
[[email protected] ~]# chown user:user file
chown: invalid user: ‘user:user’
[[email protected] ~]# chown use1r:user1 file
chown: invalid user: ‘use1r:user1’
[[email protected] ~]# chown user1:user1 file
[[email protected] ~]# ls -l file
-rw---x--x 1 user1 user1 13 Jul 20 10:59 file
[[email protected] ~]#
7. Set up suid, Set for file suid( Two ways u+s and nnnn) The way
[[email protected] ~]# ls -ld file3
drwxr-xr-x 2 root root 4096 Jul 22 00:02 file3
[[email protected] ~]# ll file
-rw---x--x 1 user1 user1 13 Jul 20 10:59 file
[[email protected] ~]# chmod 4777 file
[[email protected] ~]# ll file
-rwsrwxrwx 1 user1 user1 13 Jul 20 10:59 file
8. Set up sgid, Set for file sgid( Two ways g+s and nnnn) The way
[[email protected] ~]# chmod g+s file
[[email protected] ~]# ll file
-rwsrwsrwx 1 user1 user1 13 Jul 20 10:59 file
9. Set up sbit, Set for directory sbit( Two ways o+t and nnnn) The way
[[email protected] ~]# ll -d file3
drwxr-xr-x 2 root root 4096 Jul 22 00:02 file3
[[email protected] ~]# chmod o+t file3
[[email protected] ~]# chmod 1000 file3
[[email protected] ~]# ll -d file3
d--------T 2 root root 4096 Jul 22 00:02 file3
10. create a file , Query file acl
[[email protected] ~]# getfacl file4
# file: file4
# owner: root
# group: root
user::rw-
group::r--
other::r--
Set for file acl The user is testuser1 Permission is rwx
[[email protected] ~]# setfacl -m u:testuer:rwx file1
Set for file acl Of mask: Permission is r-x
[[email protected] ~]# setfacl -m m::rx file
边栏推荐
- Redis pipeline technology / partition
- [web vulnerability exploration] SQL injection vulnerability
- TAP 系列文章6 | TAP的应用模型
- Programming in the novel [serial 19] the moon bends in the yuan universe
- ES6 use of arrow function
- Three network modes of VMware virtual machine
- torchvision.datasets.ImageFolder前的数据整理及使用方法
- None和nan、NaN、NAN
- Use boundschecker "suggestions collection"
- strncat() strncmp()
猜你喜欢

1、 Simplification of digital logic

Lin Zhiying's injury is relatively stable

Mongodb database + graphical tools download, installation and use
![[web vulnerability exploration] SQL injection vulnerability](/img/94/dc84d7790d5a1823e4b73d513e86be.png)
[web vulnerability exploration] SQL injection vulnerability

Rails搭配OSS最佳实践

Tap series article 5 | cloud native build service

砺夏行动 2022|源启数字化圆桌论坛即将上线

anchor free yolov1

A great open source micro community light forum source code

Getting started database Days1
随机推荐
砺夏行动 2022|源启数字化圆桌论坛即将上线
The font of Siyuan notes is thinner and lighter than that in other editors (atom, VSC, sublime)
关于电脑端同步到手机端数据
Redis pipeline technology / partition
STM32F4查看系统各部分频率
J9 number theory: how can we overcome the fomo phenomenon in the digital industry?
Tensorflow one layer neural network training handwritten digit recognition
strncat() strncmp()
anchor free yolov1
Wechat applet implements a global event bus by itself
Getting started database days2
Rails with OSS best practices
Absl tutorial (4): strings Library
Upgrade unity visual studio 2019 to 2022 (throw away pirated red slag)
Analysis of video capability and future development trend based on NVR Technology
汇编语言伪指令详解(附实例)
Raspberry pie SSH login
Classification model - logistic regression, Fisher linear discriminant (SPSS)
[leetcode ladder] linked list · 203 remove linked list elements
Redis管道技术/分区