First, change the user belongs to the group
1. Create a new file Install.log
[email protected] ~]# Touch Install.log
2. Ls-l View Install.log file belongs to group root
[Email protected] ~]# ls-l
Total 4
-RW-------. 1 root root 1978 Dec 01:26 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
3, chgrp the Instal.logl file belongs to the group changed to become users
[Email protected] ~]# CHGRP users Install.log
[Email protected] ~]# ls-l
Total 4
-RW-------. 1 root root 1978 Dec 01:26 anaconda-ks.cfg
-rw-r--r--. 1 root users 0 Dec 02:38 Install.log
4, chgrp the Instal.logl file belongs to the group to change back to root
[Email protected] ~]# ls-l
Total 4
-RW-------. 1 root root 1978 Dec 01:26 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
Ii. changing the owner of the file
1. View Install.log's file owner
[Email protected] ~]# ls-l
Total 4
-RW-------. 1 root root 1978 Dec 01:26 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
2, Chown Change the owner of the Install.log file is bin
[Email protected] ~]# Chown bin Install.log
[Email protected] ~]# ls-l
Total 4
-RW-------. 1 root root 1978 Dec 01:26 anaconda-ks.cfg
-rw-r--r--. 1 bin root 0 Dec 02:38 Install.log
3. Chown change back to Install.log file owner as root
[Email protected] ~]# chown root Install.log
[Email protected] ~]# ls-l
Total 4
-RW-------. 1 root root 1978 Dec 01:26 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
Third, change the permissions of the file
R:4
W:2
X:1
Owner=4+2+1=7;group=4+2+1=7;others=0+0+0=0
770
1. View Install.log Permissions
[Email protected] ~]# Ls-al Install.log
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
The-rw-r--r--file has a permission of 644, the file owner has a readable executable, the file belongs to the group has the readable permission, the other user has the readable permission.
2, change the authority of Install.log to 777
[Email protected] ~]# chmod 777 Install.log
[Email protected] ~]# Ls-al Install.log
-rwxrwxrwx. 1 root root 0 Dec 02:38 Install.log
3, change the authority of Install.log back to 644
[Email protected] ~]# chmod 644 Install.log
[Email protected] ~]# Ls-al Install.log
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
Iv. permissions of the group to which the file belongs
Owner=u
Group=g
Other=o
A=all r+w+x
1. View Install.log Permissions
[Email protected] ~]# Ls-al Install.log
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
2. Change the Install.log authority to 777
[Email protected] ~]# chmod u=rwx,go=rwx Install.log
[Email protected] ~]# Ls-al Install.log
-rwxrwxrwx. 1 root root 0 Dec 02:38 Install.log
3, change the authority of Install.log back to 644
[Email protected] ~]# chmod u=rw,go=r Install.log
[Email protected] ~]# Ls-al Install.log
-rw-r--r--. 1 root root 0 Dec 02:38 Install.log
4. Change the Install.log authority to 755
[Email protected] ~]# Ls-al Install.log
-rwxr-xr-x. 1 root root 0 Dec 02:38 Install.log
Changing file properties and Permissions