[{"data":1,"prerenderedAt":1044},["ShallowReactive",2],{"\u002F2025\u002Ffile-permissions-and-management-in-linux":3,"surround-\u002F2025\u002Ffile-permissions-and-management-in-linux":1038},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"updated":10,"image":11,"categories":12,"tags":14,"recommend":6,"draft":6,"readingTime":15,"body":20,"_type":1031,"_id":1032,"_source":1033,"_file":1034,"_stem":1035,"_extension":1036,"_original_dir":1037},"\u002F2025\u002Ffile-permissions-and-management-in-linux","2025",false,"","File Permissions and Permission Management in Linux","In Linux operating systems, permissions are a fundamental security mechanism that determines who can access files and directories and how that access is handled.","2025-05-03T08:11:08.000Z","https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F1.jpg",[13],"Linux",[],{"text":16,"minutes":17,"time":18,"words":19},"3 min read",2.62,157200,524,{"type":21,"children":22,"toc":1011},"root",[23,31,38,43,85,90,127,134,148,153,188,199,210,221,235,271,277,318,351,384,388,400,450,456,461,494,498,542,618,630,635,639,658,664,669,675,688,692,712,733,737,757,894,900,910,914,926,936,952,958,963,975,988,1005],{"type":24,"tag":25,"props":26,"children":27},"element","p",{},[28],{"type":29,"value":30},"text","In this article, we will thoroughly examine the basic logic of permissions in Linux, changing permissions and ownership, and special permissions such as SUID, SGID, and sticky bit.",{"type":24,"tag":32,"props":33,"children":35},"h2",{"id":34},"_1-basic-logic-of-permissions",[36],{"type":29,"value":37},"1. Basic Logic of Permissions",{"type":24,"tag":25,"props":39,"children":40},{},[41],{"type":29,"value":42},"In Linux, every file and directory has three basic access types:",{"type":24,"tag":44,"props":45,"children":46},"ul",{},[47,63,74],{"type":24,"tag":48,"props":49,"children":50},"li",{},[51,61],{"type":24,"tag":52,"props":53,"children":58},"span",{"className":54,"id":56,"style":57},[55],"example-info","just-like-this","color: #00bb66",[59],{"type":29,"value":60},"Read (r)",{"type":29,"value":62},": Permission to read the contents of a file or list the contents of a directory.",{"type":24,"tag":48,"props":64,"children":65},{},[66,72],{"type":24,"tag":52,"props":67,"children":69},{"className":68,"id":56,"style":57},[55],[70],{"type":29,"value":71},"Write (w)",{"type":29,"value":73},": Permission to modify the contents of a file or add\u002Fremove files in a directory.",{"type":24,"tag":48,"props":75,"children":76},{},[77,83],{"type":24,"tag":52,"props":78,"children":80},{"className":79,"id":56,"style":57},[55],[81],{"type":29,"value":82},"Execute (x)",{"type":29,"value":84},": Permission to run a file (e.g., a script or program) or enter a directory.",{"type":24,"tag":25,"props":86,"children":87},{},[88],{"type":29,"value":89},"These permissions are defined separately for three different user categories:",{"type":24,"tag":44,"props":91,"children":92},{},[93,105,116],{"type":24,"tag":48,"props":94,"children":95},{},[96,103],{"type":24,"tag":52,"props":97,"children":100},{"className":98,"id":56,"style":99},[55],"color: #efb11d",[101],{"type":29,"value":102},"Owner (user)",{"type":29,"value":104},": The user who created or owns the file or directory.",{"type":24,"tag":48,"props":106,"children":107},{},[108,114],{"type":24,"tag":52,"props":109,"children":111},{"className":110,"id":56,"style":99},[55],[112],{"type":29,"value":113},"Group (group)",{"type":29,"value":115},": The user group associated with the file.",{"type":24,"tag":48,"props":117,"children":118},{},[119,125],{"type":24,"tag":52,"props":120,"children":122},{"className":121,"id":56,"style":99},[55],[123],{"type":29,"value":124},"Others (others)",{"type":29,"value":126},": All other users on the system.",{"type":24,"tag":128,"props":129,"children":131},"h3",{"id":130},"viewing-permissions",[132],{"type":29,"value":133},"Viewing Permissions",{"type":24,"tag":25,"props":135,"children":136},{},[137,139,146],{"type":29,"value":138},"To view permissions, use the ",{"type":24,"tag":140,"props":141,"children":143},"code",{"className":142},[],[144],{"type":29,"value":145},"ls -l",{"type":29,"value":147}," command. Example output:",{"type":24,"tag":149,"props":150,"children":152},"pic",{"src":151},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F2.jpg",[],{"type":24,"tag":25,"props":154,"children":155},{},[156,163,165,170,172,178,180,186],{"type":24,"tag":140,"props":157,"children":160},{"className":158,"id":56,"style":159},[55],"color: #48A6A7",[161],{"type":29,"value":162},"-",{"type":29,"value":164}," First character: File type (",{"type":24,"tag":140,"props":166,"children":168},{"className":167},[],[169],{"type":29,"value":162},{"type":29,"value":171}," for file, ",{"type":24,"tag":140,"props":173,"children":175},{"className":174},[],[176],{"type":29,"value":177},"d",{"type":29,"value":179}," for directory, ",{"type":24,"tag":140,"props":181,"children":183},{"className":182},[],[184],{"type":29,"value":185},"l",{"type":29,"value":187}," for symbolic link).",{"type":24,"tag":25,"props":189,"children":190},{},[191,197],{"type":24,"tag":140,"props":192,"children":194},{"className":193,"id":56,"style":159},[55],[195],{"type":29,"value":196},"rwx",{"type":29,"value":198}," (owner): Read, write, execute.",{"type":24,"tag":25,"props":200,"children":201},{},[202,208],{"type":24,"tag":140,"props":203,"children":205},{"className":204,"id":56,"style":159},[55],[206],{"type":29,"value":207},"r-x",{"type":29,"value":209}," (group): Read, execute.",{"type":24,"tag":25,"props":211,"children":212},{},[213,219],{"type":24,"tag":140,"props":214,"children":216},{"className":215,"id":56,"style":159},[55],[217],{"type":29,"value":218},"r--",{"type":29,"value":220}," (others): Read only.",{"type":24,"tag":32,"props":222,"children":224},{"id":223},"_2-changing-permissions-chmod-command",[225,227,233],{"type":29,"value":226},"2. Changing Permissions: ",{"type":24,"tag":140,"props":228,"children":230},{"className":229},[],[231],{"type":29,"value":232},"chmod",{"type":29,"value":234}," Command",{"type":24,"tag":25,"props":236,"children":237},{},[238,240,245,247,258,260,269],{"type":29,"value":239},"Use the ",{"type":24,"tag":140,"props":241,"children":243},{"className":242},[],[244],{"type":29,"value":232},{"type":29,"value":246}," command to change file and directory permissions. This command supports two methods: ",{"type":24,"tag":248,"props":249,"children":251},"a",{"href":250},"#symbolic",[252],{"type":24,"tag":253,"props":254,"children":255},"strong",{},[256],{"type":29,"value":257},"symbolic mode",{"type":29,"value":259}," and ",{"type":24,"tag":248,"props":261,"children":263},{"href":262},"#numeric-octal",[264],{"type":24,"tag":253,"props":265,"children":266},{},[267],{"type":29,"value":268},"numeric (octal) mode",{"type":29,"value":270},".",{"type":24,"tag":128,"props":272,"children":274},{"id":273},"symbolic-mode",[275],{"type":29,"value":276},"Symbolic Mode",{"type":24,"tag":25,"props":278,"children":279},{},[280,285,287,293,295,301,303,309,311,316],{"type":24,"tag":253,"props":281,"children":282},{},[283],{"type":29,"value":284},"User categories:",{"type":29,"value":286}," ",{"type":24,"tag":140,"props":288,"children":290},{"className":289,"id":56,"style":99},[55],[291],{"type":29,"value":292},"u",{"type":29,"value":294}," owner, ",{"type":24,"tag":140,"props":296,"children":298},{"className":297,"id":56,"style":99},[55],[299],{"type":29,"value":300},"g",{"type":29,"value":302}," group, ",{"type":24,"tag":140,"props":304,"children":306},{"className":305,"id":56,"style":99},[55],[307],{"type":29,"value":308},"o",{"type":29,"value":310}," others, ",{"type":24,"tag":140,"props":312,"children":314},{"className":313,"id":56,"style":99},[55],[315],{"type":29,"value":248},{"type":29,"value":317}," all.",{"type":24,"tag":25,"props":319,"children":320},{},[321,326,328,334,336,341,343,349],{"type":24,"tag":253,"props":322,"children":323},{},[324],{"type":29,"value":325},"Operators",{"type":29,"value":327},": ",{"type":24,"tag":140,"props":329,"children":331},{"className":330},[],[332],{"type":29,"value":333},"+",{"type":29,"value":335}," add permission, ",{"type":24,"tag":140,"props":337,"children":339},{"className":338},[],[340],{"type":29,"value":162},{"type":29,"value":342}," remove permission, ",{"type":24,"tag":140,"props":344,"children":346},{"className":345},[],[347],{"type":29,"value":348},"=",{"type":29,"value":350}," set permission.",{"type":24,"tag":25,"props":352,"children":353},{},[354,359,360,366,368,374,376,382],{"type":24,"tag":253,"props":355,"children":356},{},[357],{"type":29,"value":358},"Permission types",{"type":29,"value":327},{"type":24,"tag":140,"props":361,"children":363},{"className":362,"id":56,"style":57},[55],[364],{"type":29,"value":365},"r",{"type":29,"value":367}," read, ",{"type":24,"tag":140,"props":369,"children":371},{"className":370,"id":56,"style":57},[55],[372],{"type":29,"value":373},"w",{"type":29,"value":375}," write, ",{"type":24,"tag":140,"props":377,"children":379},{"className":378,"id":56,"style":57},[55],[380],{"type":29,"value":381},"x",{"type":29,"value":383}," execute.",{"type":24,"tag":149,"props":385,"children":387},{"src":386},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F3.jpg",[],{"type":24,"tag":25,"props":389,"children":390},{},[391,393,398],{"type":29,"value":392},"As seen in the image, full permissions (",{"type":24,"tag":140,"props":394,"children":396},{"className":395},[],[397],{"type":29,"value":196},{"type":29,"value":399},") were granted to the owner. Additional Examples:",{"type":24,"tag":44,"props":401,"children":402},{},[403,429],{"type":24,"tag":48,"props":404,"children":405},{},[406,427],{"type":24,"tag":140,"props":407,"children":410},{"className":408,"language":409,"style":7},"language-bash shiki shiki-themes catppuccin-latte one-dark-pro","bash",[411,416,422],{"type":24,"tag":52,"props":412,"children":414},{"style":413},"--shiki-default:#1E66F5;--shiki-default-font-style:italic;--shiki-dark:#61AFEF;--shiki-dark-font-style:inherit",[415],{"type":29,"value":232},{"type":24,"tag":52,"props":417,"children":419},{"style":418},"--shiki-default:#40A02B;--shiki-dark:#98C379",[420],{"type":29,"value":421}," go-w",{"type":24,"tag":52,"props":423,"children":424},{"style":418},[425],{"type":29,"value":426}," example.txt",{"type":29,"value":428},": Removes write permission from group and others.",{"type":24,"tag":48,"props":430,"children":431},{},[432,448],{"type":24,"tag":140,"props":433,"children":434},{"className":408,"language":409,"style":7},[435,439,444],{"type":24,"tag":52,"props":436,"children":437},{"style":413},[438],{"type":29,"value":232},{"type":24,"tag":52,"props":440,"children":441},{"style":418},[442],{"type":29,"value":443}," a=r",{"type":24,"tag":52,"props":445,"children":446},{"style":418},[447],{"type":29,"value":426},{"type":29,"value":449},": Sets read-only permission for everyone.",{"type":24,"tag":128,"props":451,"children":453},{"id":452},"numeric-octal-mode",[454],{"type":29,"value":455},"Numeric (Octal) Mode",{"type":24,"tag":25,"props":457,"children":458},{},[459],{"type":29,"value":460},"In numeric mode, each permission type is represented by a number:",{"type":24,"tag":44,"props":462,"children":463},{},[464,489],{"type":24,"tag":48,"props":465,"children":466},{},[467,473,475,481,482,488],{"type":24,"tag":140,"props":468,"children":470},{"className":469,"id":56,"style":57},[55],[471],{"type":29,"value":472},"r = 4",{"type":29,"value":474},", ",{"type":24,"tag":140,"props":476,"children":478},{"className":477,"id":56,"style":57},[55],[479],{"type":29,"value":480},"w = 2",{"type":29,"value":474},{"type":24,"tag":140,"props":483,"children":485},{"className":484,"id":56,"style":57},[55],[486],{"type":29,"value":487},"x = 1",{"type":29,"value":270},{"type":24,"tag":48,"props":490,"children":491},{},[492],{"type":29,"value":493},"Permissions are summed to create a three-digit number (owner, group, others).",{"type":24,"tag":149,"props":495,"children":497},{"src":496},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F4.jpg",[],{"type":24,"tag":25,"props":499,"children":500},{},[501,503,509,511,517,518,524,526,532,534,540],{"type":29,"value":502},"Here, permissions were changed using numeric mode. For example, ",{"type":24,"tag":140,"props":504,"children":506},{"className":505},[],[507],{"type":29,"value":508},"user",{"type":29,"value":510}," received ",{"type":24,"tag":140,"props":512,"children":514},{"className":513},[],[515],{"type":29,"value":516},"4=read",{"type":29,"value":474},{"type":24,"tag":140,"props":519,"children":521},{"className":520},[],[522],{"type":29,"value":523},"2=write",{"type":29,"value":525},", and ",{"type":24,"tag":140,"props":527,"children":529},{"className":528},[],[530],{"type":29,"value":531},"1=execute",{"type":29,"value":533}," permissions. Their sum is ",{"type":24,"tag":140,"props":535,"children":537},{"className":536},[],[538],{"type":29,"value":539},"7",{"type":29,"value":541},". Briefly, this is how it works. Additional Examples:",{"type":24,"tag":44,"props":543,"children":544},{},[545,582],{"type":24,"tag":48,"props":546,"children":547},{},[548,565,567,573,575,581],{"type":24,"tag":140,"props":549,"children":550},{"className":408,"language":409,"style":7},[551,555,561],{"type":24,"tag":52,"props":552,"children":553},{"style":413},[554],{"type":29,"value":232},{"type":24,"tag":52,"props":556,"children":558},{"style":557},"--shiki-default:#FE640B;--shiki-dark:#D19A66",[559],{"type":29,"value":560}," 755",{"type":24,"tag":52,"props":562,"children":563},{"style":418},[564],{"type":29,"value":426},{"type":29,"value":566},": Full permission for owner ",{"type":24,"tag":140,"props":568,"children":570},{"className":569,"id":56,"style":57},[55],[571],{"type":29,"value":572},"7 = 4+2+1",{"type":29,"value":574},", read and execute for group and others ",{"type":24,"tag":140,"props":576,"children":578},{"className":577,"id":56,"style":57},[55],[579],{"type":29,"value":580},"5 = 4+1",{"type":29,"value":270},{"type":24,"tag":48,"props":583,"children":584},{},[585,601,603,609,611,617],{"type":24,"tag":140,"props":586,"children":587},{"className":408,"language":409,"style":7},[588,592,597],{"type":24,"tag":52,"props":589,"children":590},{"style":413},[591],{"type":29,"value":232},{"type":24,"tag":52,"props":593,"children":594},{"style":557},[595],{"type":29,"value":596}," 644",{"type":24,"tag":52,"props":598,"children":599},{"style":418},[600],{"type":29,"value":426},{"type":29,"value":602},": Read and write for owner ",{"type":24,"tag":140,"props":604,"children":606},{"className":605,"id":56,"style":57},[55],[607],{"type":29,"value":608},"6 = 4+2",{"type":29,"value":610},", read-only for group and others ",{"type":24,"tag":140,"props":612,"children":614},{"className":613,"id":56,"style":57},[55],[615],{"type":29,"value":616},"4",{"type":29,"value":270},{"type":24,"tag":32,"props":619,"children":621},{"id":620},"_3-changing-ownership-chown",[622,624],{"type":29,"value":623},"3. Changing Ownership: ",{"type":24,"tag":140,"props":625,"children":627},{"className":626},[],[628],{"type":29,"value":629},"chown",{"type":24,"tag":25,"props":631,"children":632},{},[633],{"type":29,"value":634},"Change file\u002Fdirectory ownership with:",{"type":24,"tag":149,"props":636,"children":638},{"src":637},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F5.jpg",[],{"type":24,"tag":640,"props":641,"children":643},"alert",{"type":642},"error",[644,653],{"type":24,"tag":645,"props":646,"children":647},"template",{"v-slot:title":7},[648],{"type":24,"tag":25,"props":649,"children":650},{},[651],{"type":29,"value":652},"Warning",{"type":24,"tag":25,"props":654,"children":655},{},[656],{"type":29,"value":657},"This command typically requires root privileges.",{"type":24,"tag":32,"props":659,"children":661},{"id":660},"_4-special-permissions-suid-sgid-and-sticky-bit",[662],{"type":29,"value":663},"4. Special Permissions: SUID, SGID, and Sticky Bit",{"type":24,"tag":25,"props":665,"children":666},{},[667],{"type":29,"value":668},"Linux has special permissions that alter file\u002Fdirectory behavior: SUID, SGID, and sticky bit.",{"type":24,"tag":128,"props":670,"children":672},{"id":671},"suid-set-user-id",[673],{"type":29,"value":674},"SUID (Set User ID)",{"type":24,"tag":25,"props":676,"children":677},{},[678,680,686],{"type":29,"value":679},"When set on a program, it runs with the ",{"type":24,"tag":253,"props":681,"children":683},{"className":682,"id":56,"style":57},[55],[684],{"type":29,"value":685},"owner's",{"type":29,"value":687}," permissions (not the executor's).",{"type":24,"tag":149,"props":689,"children":691},{"src":690},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F6.jpg",[],{"type":24,"tag":25,"props":693,"children":694},{},[695,697,703,705,710],{"type":29,"value":696},"In this example, the ",{"type":24,"tag":140,"props":698,"children":700},{"className":699},[],[701],{"type":29,"value":702},"passwd",{"type":29,"value":704}," command runs with ",{"type":24,"tag":140,"props":706,"children":708},{"className":707},[],[709],{"type":29,"value":21},{"type":29,"value":711},"'s permissions (owner), allowing password changes. If another user owned the program, it would run with their permissions.",{"type":24,"tag":25,"props":713,"children":714},{},[715,717,723,725,731],{"type":29,"value":716},"Set SUID with ",{"type":24,"tag":140,"props":718,"children":720},{"className":719},[],[721],{"type":29,"value":722},"chmod u+s",{"type":29,"value":724}," and remove with ",{"type":24,"tag":140,"props":726,"children":728},{"className":727},[],[729],{"type":29,"value":730},"u-s",{"type":29,"value":732},":",{"type":24,"tag":149,"props":734,"children":736},{"src":735},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F7.jpg",[],{"type":24,"tag":25,"props":738,"children":739},{},[740,742,748,750,755],{"type":29,"value":741},"When SUID is removed, ",{"type":24,"tag":140,"props":743,"children":745},{"className":744},[],[746],{"type":29,"value":747},"s",{"type":29,"value":749}," becomes ",{"type":24,"tag":140,"props":751,"children":753},{"className":752},[],[754],{"type":29,"value":381},{"type":29,"value":756}," in permissions. The reverse applies too.",{"type":24,"tag":640,"props":758,"children":759},{"type":642},[760,767,803,861],{"type":24,"tag":645,"props":761,"children":762},{"v-slot:title":7},[763],{"type":24,"tag":25,"props":764,"children":765},{},[766],{"type":29,"value":652},{"type":24,"tag":25,"props":768,"children":769},{},[770,772,778,780,786,788,794,796,801],{"type":29,"value":771},"SUID only applies to executable files. For non-executable files (e.g., ",{"type":24,"tag":140,"props":773,"children":775},{"className":774},[],[776],{"type":29,"value":777},"test.txt",{"type":29,"value":779}," with ",{"type":24,"tag":140,"props":781,"children":783},{"className":782},[],[784],{"type":29,"value":785},"-rw-r--r--",{"type":29,"value":787}," permissions), setting SUID shows an uppercase ",{"type":24,"tag":140,"props":789,"children":791},{"className":790},[],[792],{"type":29,"value":793},"S",{"type":29,"value":795}," in ",{"type":24,"tag":140,"props":797,"children":799},{"className":798},[],[800],{"type":29,"value":145},{"type":29,"value":802},". Example:",{"type":24,"tag":804,"props":805,"children":807},"pre",{"className":408,"code":806,"language":409,"meta":7,"style":7},"-rwSr--r-- 1 user group 0 Apr 10 12:00 test.txt\n",[808],{"type":24,"tag":140,"props":809,"children":810},{"__ignoreMap":7},[811],{"type":24,"tag":52,"props":812,"children":815},{"class":813,"line":814},"line",1,[816,821,826,831,836,841,846,851,856],{"type":24,"tag":52,"props":817,"children":818},{"style":413},[819],{"type":29,"value":820},"-rwSr--r--",{"type":24,"tag":52,"props":822,"children":823},{"style":557},[824],{"type":29,"value":825}," 1",{"type":24,"tag":52,"props":827,"children":828},{"style":418},[829],{"type":29,"value":830}," user",{"type":24,"tag":52,"props":832,"children":833},{"style":418},[834],{"type":29,"value":835}," group",{"type":24,"tag":52,"props":837,"children":838},{"style":557},[839],{"type":29,"value":840}," 0",{"type":24,"tag":52,"props":842,"children":843},{"style":418},[844],{"type":29,"value":845}," Apr",{"type":24,"tag":52,"props":847,"children":848},{"style":557},[849],{"type":29,"value":850}," 10",{"type":24,"tag":52,"props":852,"children":853},{"style":418},[854],{"type":29,"value":855}," 12:00",{"type":24,"tag":52,"props":857,"children":858},{"style":418},[859],{"type":29,"value":860}," test.txt\n",{"type":24,"tag":25,"props":862,"children":863},{},[864,866,871,873,879,881,886,888,893],{"type":29,"value":865},"Uppercase ",{"type":24,"tag":140,"props":867,"children":869},{"className":868},[],[870],{"type":29,"value":793},{"type":29,"value":872}," indicates SUID is set but the file is not executable. Adding execute permission (",{"type":24,"tag":140,"props":874,"children":876},{"className":875},[],[877],{"type":29,"value":878},"chmod u+x test.txt",{"type":29,"value":880},") changes ",{"type":24,"tag":140,"props":882,"children":884},{"className":883},[],[885],{"type":29,"value":793},{"type":29,"value":887}," to lowercase ",{"type":24,"tag":140,"props":889,"children":891},{"className":890},[],[892],{"type":29,"value":747},{"type":29,"value":270},{"type":24,"tag":128,"props":895,"children":897},{"id":896},"sgid-set-group-id",[898],{"type":29,"value":899},"SGID (Set Group ID)",{"type":24,"tag":25,"props":901,"children":902},{},[903,908],{"type":24,"tag":253,"props":904,"children":905},{},[906],{"type":29,"value":907},"For files",{"type":29,"value":909},": The program runs with the group's permissions.",{"type":24,"tag":149,"props":911,"children":913},{"src":912},"https:\u002F\u002Fhackpaper-image-server.netlify.app\u002Fimages\u002Fblogs\u002Ffile-permissions-and-management-in-linux\u002F8.jpg",[],{"type":24,"tag":25,"props":915,"children":916},{},[917,919,924],{"type":29,"value":918},"Like SUID, the ",{"type":24,"tag":140,"props":920,"children":922},{"className":921},[],[923],{"type":29,"value":702},{"type":29,"value":925}," program here runs with the group's permissions due to SGID.",{"type":24,"tag":25,"props":927,"children":928},{},[929,934],{"type":24,"tag":253,"props":930,"children":931},{},[932],{"type":29,"value":933},"For directories",{"type":29,"value":935},": New files inherit the directory's group ownership. Files created in an SGID-enabled folder take the folder's group, not the creator's default group.",{"type":24,"tag":640,"props":937,"children":939},{"type":938},"warning",[940,947],{"type":24,"tag":645,"props":941,"children":942},{"v-slot:title":7},[943],{"type":24,"tag":25,"props":944,"children":945},{},[946],{"type":29,"value":652},{"type":24,"tag":25,"props":948,"children":949},{},[950],{"type":29,"value":951},"Files created in an SGID-enabled folder do not automatically inherit SUID\u002FSGID. These bits must be set manually.",{"type":24,"tag":128,"props":953,"children":955},{"id":954},"sticky-bit",[956],{"type":29,"value":957},"Sticky Bit",{"type":24,"tag":25,"props":959,"children":960},{},[961],{"type":29,"value":962},"Sticky Bit restricts file deletion in shared directories to owners or root.",{"type":24,"tag":25,"props":964,"children":965},{},[966,968,974],{"type":29,"value":967},"Enable with ",{"type":24,"tag":140,"props":969,"children":971},{"className":970},[],[972],{"type":29,"value":973},"chmod o+t \u003Cdirectory>",{"type":29,"value":270},{"type":24,"tag":25,"props":976,"children":977},{},[978,980,986],{"type":29,"value":979},"Example: ",{"type":24,"tag":140,"props":981,"children":983},{"className":982},[],[984],{"type":29,"value":985},"\u002Ftmp",{"type":29,"value":987}," is a shared directory. With Sticky Bit, users can only delete their own files.",{"type":24,"tag":640,"props":989,"children":991},{"type":990},"info",[992,1000],{"type":24,"tag":645,"props":993,"children":994},{"v-slot:title":7},[995],{"type":24,"tag":25,"props":996,"children":997},{},[998],{"type":29,"value":999},"Note",{"type":24,"tag":25,"props":1001,"children":1002},{},[1003],{"type":29,"value":1004},"Sticky Bit only affects file deletion\u002Frenaming; content modification is controlled by file permissions.",{"type":24,"tag":1006,"props":1007,"children":1008},"style",{},[1009],{"type":29,"value":1010},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":1012,"depth":1012,"links":1013},4,[1014,1019,1024,1026],{"id":34,"depth":1015,"text":37,"children":1016},2,[1017],{"id":130,"depth":1018,"text":133},3,{"id":223,"depth":1015,"text":1020,"children":1021},"2. Changing Permissions: chmod Command",[1022,1023],{"id":273,"depth":1018,"text":276},{"id":452,"depth":1018,"text":455},{"id":620,"depth":1015,"text":1025},"3. Changing Ownership: chown",{"id":660,"depth":1015,"text":663,"children":1027},[1028,1029,1030],{"id":671,"depth":1018,"text":674},{"id":896,"depth":1018,"text":899},{"id":954,"depth":1018,"text":957},"markdown","content:posts:2025:file-permissions-and-management-in-linux.md","content","posts\u002F2025\u002Ffile-permissions-and-management-in-linux.md","posts\u002F2025\u002Ffile-permissions-and-management-in-linux","md","\u002Fposts",[1039,1040],null,{"_path":1041,"title":1042,"date":1043},"\u002F2025\u002F2-dev-null-command-what-is-and-what-is-useful","What is the 2>\u002Fdev\u002Fnull Command and What Does It Do?","2025-05-03T12:55:53.000Z",1776877921254]