|
1
2
3
4
5
6
|
[root@localhost ~]# ls -l /etc
total 1880
drwxr-xr-x. 3 root root 4096 Aug 6 04:54 abrt
drwxr-xr-x. 4 root root 4096 Aug 6 05:05 acpi
-rw-r--r--. 1 root root 49 Aug 19 17:52 adjtime
-rw-r--r--. 1 root root 1512 Jan 12 2010 aliases
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@localhost ~]# ls -l /home/tesla/inittab
-rw-r--r-- 1 tesla tesla 884 Aug 20 21:13 /home/tesla/inittab
[root@localhost ~]# chmod 666 /home/tesla/inittab
[root@localhost ~]# ls -l /home/tesla/inittab
-rw-rw-rw- 1 tesla tesla 884 Aug 20 21:13 /home/tesla/inittab
[root@localhost ~]# chmod u=rwx /home/tesla/inittab
[root@localhost ~]# ls -l /home/tesla/inittab
-rwxrw-rw- 1 tesla tesla 884 Aug 20 21:13 /home/tesla/inittab
[root@localhost ~]# chmod g-w /home/tesla/inittab
[root@localhost ~]# ls -l /home/tesla/inittab
-rwxr--rw- 1 tesla tesla 884 Aug 20 21:13 /home/tesla/inittab
[root@localhost ~]# chmod --reference=/etc/passwd /home/tesla/inittab
[root@localhost ~]# ls -l /home/tesla/inittab
-rw-r--r-- 1 tesla tesla 884 Aug 20 21:13 /home/tesla/inittab
|
|
1
2
3
4
5
|
[root@localhost ~]# ls -l /usr/bin/passwd
-rwsr-xr-x. 1 root root 30768 Feb 22 2012 /usr/bin/passwd
[root@localhost ~]# chmod u-x /usr/bin/passwd
[root@localhost ~]# ls -l /usr/bin/passwd
-rwSr-xr-x. 1 root root 30768 Feb 22 2012 /usr/bin/passwd
|
|
1
2
3
4
5
6
7
|
[root@localhost ~]# ls -ld /home/tesla/genius
drwxrwxr-x 2 tesla tesla 4096 Aug 21 02:44 /home/tesla/genius
[root@localhost ~]# chmod g+s /home/tesla/genius
[root@localhost ~]# touch /home/tesla/genius/sb
[root@localhost ~]# ls -l /home/tesla/genius
total 0
-rw-r--r-- 1 root tesla 0 Aug 21 02:51 sb
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
[root@localhost ~]# getfacl /home/tesla/inittab
getfacl: Removing leading '/' from absolute path names
# file: home/tesla/inittab
# owner: tesla
# group: tesla
user::rw-
group::r--
mask::r--
other::r--
[root@localhost ~]# setfacl -m u:wittgenstein:rw- /home/tesla/inittab
[root@localhost ~]# getfacl /home/tesla/inittab
getfacl: Removing leading '/' from absolute path names
# file: home/tesla/inittab
# owner: tesla
# group: tesla
user::rw-
user:wittgenstein:rw-
group::r--
mask::rw-
other::r--
|
|
1
2
3
4
5
6
7
8
9
10
11
|
[root@localhost ~]# umask
0022
[root@localhost ~]# umask 045
[root@localhost ~]# umask
0045
[root@localhost ~]# mkdir /home/jack
[root@localhost ~]# ls -ld /home/jack
drwx-wx-w- 2 root root 4096 Aug 21 03:54 /home/jack
[root@localhost ~]# touch /home/jack/rose
[root@localhost ~]# ls -l /home/jack/rose
-rw--w--w- 1 root root 0 Aug 21 03:56 /home/jack/rose
|
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30112369/viewspace-1808917/ ,如需转载,请注明出处,否则将追究法律责任。