Sothebigthebigtoolsthatwe'regonnabeusingtodaysomethingcalled C h o W n basicallycameowner.
Sowiththiscommanderabletochangetheownershipof a fileorfoldersoyoucanchangetheuseraccountownershipandyoucanchangethegroupaccountownershipforthefilefoldersothatthepermissionsthatcorrespondtotheuseraccountownerandthegroupaccountownercanthenbeasidetotheuserandtothatgroupaccount.
Andthen I willalsoshowyouthechangeModCommandor C H M o D.
A commandonwhatthisdoesisthisactuallyallowsyoutokinkthepermissionfor a filefolder.
Soyoucanyousee h m o d youknowthan 777751157 Whateverhadhowyouwantthepermissionstobe, so I'llshowyouthosetwocommandstodayandthosewillbethetwoprimarycommands, and I'm showingyou.
We'llalsoshowyou a coupleofothercommandsthatareinteresting, suchasthegroup's command.
Thegroup's commandallowsyoutoseewhatgroups a surfinguseraccountis.
L Sothisisgoingtolistthefilesandfolderswithinthisdirectoryandgiveussomemoreofthatsecurityinformation.
Sowhatdo l s l givemetotaloffourresults, and I couldgooverhereand I canseethedifferentthingsfrom a testfile, a testfolder, a timberfileand a timfiletoo.
Sothosefouritems, basically I havethreefilesandonefolderagainstyouwiththepermissionsaresoforthetestfileread, writefortheuseraccountthatownsthetestfileread, writeforthegroupuseraccountthatownstestfileandthenreadpermissionforeverybodyelse.
Wecomeoverhereandwetake a lookattheuserinthegroupaccount.
Sowehavethebobuseraccount.
Andwheneveryoucreate a user, they'realsogiventheirowngroup.
Testgroupisthegroupowner, andwecangooverandwecantake a lookatthepermissions.
There s sothatbasicallyjustgivesyouanideaofthefiles, folders, permissionsandgroupownershipwithinthisparticulardirectory s.
Sothefirstthingthat I maybeinterestedinisbasicallywondering.
I wonderwhatgroups I am a partof, right?
So I wanttodo a sign, uh, permissionssothat I'm abletoaccess a fileorfolder.
But I maybemaynotwanttobethespecificthetheuserownerofthatfilefolder.
Oneofthequestionsthatshipcanbeaskediswhatgroupsam I a memberof?
Soif I simplyusethegroup's commandsothegroup's commandabsolutelynothingelseandhitEnter.
Thisshowsmewhatgroups I am a member.
So I amtheBobaccountsthatBobistheinitialcountthat's createdwhenyoucreate.
Youbumpeditwhenyouinstallthe U Bahntoserver.
So I'm inthatBob S O.
I'm inallthegroupsthatarepartofthat.
Andso I am a memberoftheBobGroup.
I'm a memberofthe A T M Group.
I'm a memberoftheCDROM's group, thepseudogroup, because I coulduseOoh d'ohdipplug, depth, Alexey.
Sothesearethemembers I amcurrentlyortheseairthegroup's I amcurrently a memberof.
Butlet's thinkaboutitfor a secondago, huh?
I wonderwhatgroupsTimis a memberoforsue.
Soif I usegroupsspaceandthensimplywhatevertheusernameis, let's say, Tim, thesooner I canseethatTimis a memberoftheTempleGroupandhe's a memberofthetestgroup.
If I dogroupsandthenChloeinSoo, seewhatshe's a memberoff?
Sothisis a way I cansitthereandseewhatgroupscertainusersaremembersoffnow.
Aninterestingthingalsoisthere's actually a member's commandthatyoucanusenowifyou'regoingtousethemembers a command, atleaston a bunto 18.4 Lt s youactuallyhavetoaddit.
Soif I domembersandthen I simplydospaceandthenlet's say I dotestgroupener, then I canseethemembersofthegrouptestgroupareTimandSue.
Soagain, that's anotherwayofsittingthere.
If I'm sittinghereandgoing, okay, well, whoarethemembersofTestGroup?
So I knowhowthepermissionsarebeingdealtwithmynewmemberstestgroupandplugthatinOregon.
Newmembers, anothergroupanddinner?
No, I guesstherearenomembersofanothergroup, so I know.
Okay, soandthat's whentheproblemsyoucanrunintointherealworldisimagineyoucreate a group, youforgettoputmembersintothatgroup, andthenyoucreatethepermission.
Youmakethat a groupowner.
Thatmightbetheproblemyou'rerunninginto.
Youmeanttoput a userintothatgroup, butyoudidn't.
Now, ifwedoclearoneofthingsthat I canshowyouisyoucanalsousethisthingcalledThecatCommandisbasicallythecatcommandallowsyoutoviewfilesinthesystem, andsowedoforwardslash e t c E T C fourslashgroupThisisthetextfilethathasallofyourgroups.
Andthenwhat I'm goingtodois I'm gonnapipethisthroughlessso I can I canseethisandwhatscrollbyme.
AndsowhatthisisgoingtodoisthisbasicallyisgoingtoallowmetoviewthisfinalcoldgroupthisfilecalledGroupinthe E.
Modernman C h m o d commandagainwhenyou'redealingwithfolderssomethingthatyouneedtobethinkingabout, Doyouwanttochangethepermissionandjustforthefolderitselfor a recursiveforeverythinginthere.
Wewantthegroupaccountthatownsittohave a readpermission, andtheywanteverybodyelsetolet's say I havenothingagainst 740 sowecouldbehere a pseudo c h m o d.
Seventhenwe d'ohrecursivehyphen R 740 fortestfolder.
Sobasicallychange.
ChangeofpermissionsRecursiveleethroughoutthefolderto 740 fortestfolderthatweenterafin L s hyphen l Andtherewego.
Nowwehave a test.
Fulleragain.
Readright.
ExecuteforBobtheowner A readformembersofthetestgroupandnobodyelsehaspermissiontodoanythinginthefolder.
Uh, ifyoutypinggroupsspaceandthenwhatevertheuseraccountyou'reinterestedin, itwillshowyouthegroupsthatthatuseraccountis a memberofthememberstoolisveryuseful.
Thememberscommandshowsyouthemembershipswhois a memberofcertaingroups.
Andyou'renotreallythinkingaboutitbecauseyouhaven't messedwiththepermissionsin a monthbecause, rightyoudidnot a monthago, whenyouwerefirstsettinguptheboxandsoyouthinkyouknow, I'lljustforwardthepoortotheInternet.
Andnowbasically, youknow, anyjackass, jackassortheconnectiontotheInternetisabletohackyoursystem, andthat's a badthing.
Linux - 更改文件和文件夾的權限和所有權(chmod, chown, members, groups)。 (Linux - Change Permissions and Ownership for Files and Folders (chmod, chown, members, groups ))