-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpermission Example
More file actions
90 lines (90 loc) · 3.41 KB
/
permission Example
File metadata and controls
90 lines (90 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
[root@ip-172-31-7-225 manas]# chmod u+x a.txt
[root@ip-172-31-7-225 manas]# ls -l a.txt
-rwxr--r--. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod g+wx o+wx a.txt
chmod: cannot access ‘o+wx’: No such file or directory
[root@ip-172-31-7-225 manas]# ls -l
total 0
-rwxrwxr--. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# o+wx a.txt
-bash: o+wx: command not found
[root@ip-172-31-7-225 manas]# a+wx
-bash: a+wx: command not found
[root@ip-172-31-7-225 manas]# a+wx a.txt
-bash: a+wx: command not found
[root@ip-172-31-7-225 manas]# clear
[root@ip-172-31-7-225 manas]# chmod u-rwx a.txt
[root@ip-172-31-7-225 manas]# ls -ld
drwxrwxr-t+ 2 root root 19 Jun 9 16:39 .
[root@ip-172-31-7-225 manas]# ls -ld a.txt
----rwxr--. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod g-rwx a.txt
[root@ip-172-31-7-225 manas]# ls -ld a.txt
-------r--. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod o-r a.txt
[root@ip-172-31-7-225 manas]# ls -l
total 0
----------. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# ls -d
.
[root@ip-172-31-7-225 manas]#
login as: ec2-user
Authenticating with public key "imported-openssh-key"
Last login: Sun Jun 9 16:35:37 2019 from 157.47.239.69
[ec2-user@ip-172-31-7-225 ~]$ sudo -i
[root@ip-172-31-7-225 ~]# cd manas
[root@ip-172-31-7-225 manas]# ls
a.txt
[root@ip-172-31-7-225 manas]# a.txt
-bash: a.txt: command not found
[root@ip-172-31-7-225 manas]# ls -ld a.txt
----------. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]#
login as: ec2-user
Authenticating with public key "imported-openssh-key"
Last login: Sun Jun 9 16:48:20 2019 from 157.47.239.69
[ec2-user@ip-172-31-7-225 ~]$ sudo -i
[root@ip-172-31-7-225 ~]# cd mans
-bash: cd: mans: No such file or directory
[root@ip-172-31-7-225 ~]# cd manas
[root@ip-172-31-7-225 manas]# ls
a.txt
[root@ip-172-31-7-225 manas]# chmod a+rwx a.txt
[root@ip-172-31-7-225 manas]# ls -ld
drwxrwxr-t+ 2 root root 19 Jun 9 16:39 .
[root@ip-172-31-7-225 manas]# ls -ld a.txt
-rwxrwxrwx. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod a-rwx a.txt
[root@ip-172-31-7-225 manas]# ls -ld a.txt
----------. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod a+rwx a.txt
[root@ip-172-31-7-225 manas]# ls -ld
drwxrwxr-t+ 2 root root 19 Jun 9 16:39 .
[root@ip-172-31-7-225 manas]# ls -ld a.txt
-rwxrwxrwx. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod u=r a.txt
[root@ip-172-31-7-225 manas]# ls -ld a.txt
-r--rwxrwx. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod g=rx a.txt
[root@ip-172-31-7-225 manas]# ls -ld a.txt
-r--r-xrwx. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]# chmod o=w a.txt
[root@ip-172-31-7-225 manas]# ls -ld
drwxrwxr-t+ 2 root root 19 Jun 9 16:39 .
[root@ip-172-31-7-225 manas]# ls -ld a.txt
-r--r-x-w-. 1 root root 0 Jun 9 16:39 a.txt
[ec2-user@ip-172-31-7-225 ~]$ cd manas
[ec2-user@ip-172-31-7-225 manas]$ chmod ugo-rwx a.txt
chmod: cannot access ‘a.txt’: No such file or directory
[ec2-user@ip-172-31-7-225 manas]$ ls
Untitled.ipynb
[ec2-user@ip-172-31-7-225 manas]$ sudo -i
[root@ip-172-31-7-225 ~]# cd manas
[root@ip-172-31-7-225 manas]# ls
a.txt
[root@ip-172-31-7-225 manas]# chmod ugo-rwx a.txt
[root@ip-172-31-7-225 manas]# ls -ld
drwxrwxr-t+ 2 root root 19 Jun 9 16:39 .
[root@ip-172-31-7-225 manas]# ls -ld a.txt
----------. 1 root root 0 Jun 9 16:39 a.txt
[root@ip-172-31-7-225 manas]#