650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/06/58bb4cfd31e07392c6fa39b6c264c40f.png "title=" 1.png " Width= "height=" 194 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:194px; "alt=" 58bb4cfd31e07392c6fa39b6c264c40f.png "/>
Simulated environment three users
1, Master testhost simulation user
2. Family member Testauxiliary Simulation group
1 and 2 's family name Testgroup
3, Outsiders testout simulation other
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/2e6c2aa2b8093bdd6b91bdcde9721b1b.png "title=" 11.png "Width=" 680 "height=" 253 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:680px;height:253px; "alt=" 2e6c2aa2b8093bdd6b91bdcde9721b1b.png "/>
How do I modify a user group if the Testhost user already exists?
Usermod-g Testgroup Testhost
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/78ca98f124b9ad030536dbf7a4746359.png "title=" 111. PNG "width=" 680 "height=" 219 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:680PX;HEIGHT:219PX; "alt=" 78ca98f124b9ad030536dbf7a4746359.png "/>
Open four conversations for root,testhost,testauxiliary,testout users
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/2a853e14de54565bf868855b1c68380d.png "title=" 2.png " Width= "height=" 123 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:123px; "alt=" 2a853e14de54565bf868855b1c68380d.png "/>
The following creates the file for simulation
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/67393b2251707d249a074659ef9c53c9.png "style=" width : 700px;height:210px; "title=" A.png "width=" "height=" 0 "border=" 0 "hspace=" 0 "vspace=" "alt=" 67393b2251707d249a074659ef9c53c9.png "/>
Three User environments view:
650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/06/f4f222acd362305ffa36fc3af3558eff.png "style=" width : 600px;height:117px; "title=" B.png "width=" "height=" 117 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" F4f222acd362305ffa36fc3af3558eff.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/06/a353beb5eb744d20b8ae4503eec3223a.png "style=" width : 600px;height:117px; "title=" C.png "width=" "height=" 117 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" A353beb5eb744d20b8ae4503eec3223a.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/40d4ef97b7bf62bdf299791cdae94242.png "title=" D.png " Width= "height=" border= "0" hspace= "0" vspace= "0" style= "width:600px;height:115px;" alt= " 40d4ef97b7bf62bdf299791cdae94242.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/06/d53dd7c0f249d7791b84bef28dac03e5.png "title=" aa.png "alt=" D53dd7c0f249d7791b84bef28dac03e5.png "/>
three of them do not belong to root user,root group, so can only belong to this other inside (read and execute, not write)
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/e4c8abae438f9313d132e7ddc861d742.png "title=" qq.png "alt=" E4c8abae438f9313d132e7ddc861d742.png "/>
It can't be written with vim.
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/d97bc96afe1e0f66ba358e6c96069a18.png "title=" tt.png "Width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px;height:41px; "alt=" D97bc96afe1e0f66ba358e6c96069a18.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/6d5164df838bc28432110364b5af464d.png "style=" width : 680px;height:84px; "title=" Yy.png "width=" 680 "height=" + "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 6d5164df838bc28432110364b5af464d.png "/>
The modified document is now owned by the owner and belongs to the group, instead
650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/06/899c2855c1118721905c3bb57e655627.png "title=" 1111. PNG "width=" "height=" 145 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px;height:145px; "alt=" 899c2855c1118721905c3bb57e655627.png "/>
and thenyou can write this file as a master (testhost).
Root can also
and then testauxiliary and testout still can't write .
One for group permissions and one for other permissions
650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/06/5e34a3c51e37aeedf764fe9d8ffe1a7c.png "style=" width : 600px;height:48px; "title=" Eer.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 5e34a3c51e37aeedf764fe9d8ffe1a7c.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/06/b86ee72ec99a21dbe92eb5877bc5236f.png "style=" width : 600px;height:76px; "title=" Eerr.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" B86ee72ec99a21dbe92eb5877bc5236f.png "/>
Testauxiliary belong to a group of permissions, did not write
650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/06/ca340277e93fef71f702dc900d024485.png "title=" 1212121.png "width=" height= "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:44px; "alt=" Ca340277e93fef71f702dc900d024485.png "/>
Testout belongs to other rights, not written
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/623dc7c1de8acaddcd53fac2db6d59b9.png "style=" width : 680px;height:272px; "title=" A1.png "width=" 680 "height=" 272 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 623dc7c1de8acaddcd53fac2db6d59b9.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/06/50b2a3adc5193adcb6f1e9b25e9eeb8b.png "style=" width : "title=" A2.png "width=" 680 "height=" 680px;height:91px "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 50b2a3adc5193adcb6f1e9b25e9eeb8b.png "/>
Modify other user permissions under the current owner's user, or under root
650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/06/013fa8f2cdce49f6cca7234d842b708f.png "title=" q1.png "Width=" 680 "height=" 234 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:680px;height:234px; "alt=" 013fa8f2cdce49f6cca7234d842b708f.png "/>
I can't even read it, but I can't do it without the permission of X.
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/80176efcf66dfb664ba989b9d2a48b6f.png "style=" width : 680px;height:46px; "title=" W1.png "width=" 680 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 80176efcf66dfb664ba989b9d2a48b6f.png "/>
change the group to WX permission, no R
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/2bc4c9c3a23150d6a6e230b57859b28d.png "style=" width : 600px;height:50px; "title=" W2.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 2bc4c9c3a23150d6a6e230b57859b28d.png "/>
I can't read it.
650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/06/8f69bdd656dd9388da15cc8fb0526e02.png "title=" z1.png "Width=" "height=" 98 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:98px; "alt=" 8f69bdd656dd9388da15cc8fb0526e02.png "/>
The ability to write (edit) is to be forced to save, and not to see the previous. Can't do it.
and using the VIM editor will overwrite the original content, unless you use echo to go after the redirect
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/1d9832c86f84b90055770aa0640215e9.png "title=" t1.png "Width=" height= "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:700PX;HEIGHT:27PX; "alt=" 1d9832c86f84b90055770aa0640215e9.png "/>
deleting files
Controlled by permissions of the parent directory
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/af35745fe89a7ad9c6d54648acedd875.png "style=" float: none; "title=" F1.png "alt=" Af35745fe89a7ad9c6d54648acedd875.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/f6ff86e46a2ec42f964a30e3cacc47b9.png "style=" float: none; "title=" F2.png "alt=" F6ff86e46a2ec42f964a30e3cacc47b9.png "/>
Can't delete
650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/06/10d171a217d67c51a9edf0cf29badc86.png "style=" width : 700px;height:168px; "title=" Aaaaaaaaaa.png "width=" "height=" "168" border= "0" hspace= "0" vspace= "0" alt= " 10d171a217d67c51a9edf0cf29badc86.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/06/62bf14809fd268e50d06eb7cac69ced8.png "style=" width : 650px;height:385px; "title=" Bbbbbbbbbbb.png "width=" 650 "height=" 385 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 62bf14809fd268e50d06eb7cac69ced8.png "/>
Two graphs one meaning
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/8d202827c1568e258ac9b1af5907f425.png "style=" width : 650px;height:404px; "title=" Ccccccccccccc.png "width=" 650 "height=" 404 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 8d202827c1568e258ac9b1af5907f425.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/06/0e99ea26cc06bdd4fd9bbebec6911aeb.png "style=" width : 680px;height:145px; "title=" Ddddddddddd.png "width=" 680 "height=" 145 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" 0e99ea26cc06bdd4fd9bbebec6911aeb.png "/>
Although this file is testhost, deleting the file depends on the permissions of the parent directory.
and the parent directory is /testdir, and the master group is root.
Testhost can only be the permissions of other users, so it cannot be deleted.
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/5f1a459b014f6c99357d42188b909cb5.png "title=" g1.png "Width=" "height=" 158 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px;height:158px; "alt=" 5f1a459b014f6c99357d42188b909cb5.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/002aa98ea89dd1ed61cf925790b318e2.png "title=" v1.png "alt=" 002aa98ea89dd1ed61cf925790b318e2.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/06/505c12c539d7683d9edd25e243554141.png "style=" float: none; "title=" V2.png "alt=" 505c12c539d7683d9edd25e243554141.png "/>
Now add additional user rights to the parent directory, plus w permissions
You can delete
See if other users can delete
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/06/bb547357cebebabc78021c9d4ab217d2.png "title=" h1.png "Width=" "height=" 135 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:135px; "alt=" Bb547357cebebabc78021c9d4ab217d2.png "/>
OK
Even if I do not have permission to the file, but I have the authority of the superior directory, you can delete
This article is from the "11745576" blog, please be sure to keep this source http://11755576.blog.51cto.com/11745576/1979380
Linux file Permissions