{"id":79078,"date":"2026-11-17T01:54:33","date_gmt":"2026-11-17T01:54:33","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79078"},"modified":"2026-11-17T01:54:33","modified_gmt":"2026-11-17T01:54:33","slug":"linux-intermediate-02-acls","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79078","title":{"rendered":"Linux Intermediate 02 \u2014 Access Control Lists and Shared Directories"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1991\">Linux Intermediate category<\/a> \u00b7 Lesson 2 of 9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This lesson draws on the linked Open Education posts and adds original explanations or lab examples where useful. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Grant and remove a narrowly scoped named-user ACL and distinguish a grant from effective access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In an extended POSIX ACL, the mask caps permissions for the owning group and named nonowner entries. Access ACLs affect the object itself. Default ACLs exist on directories and can affect newly created children. They do not rewrite children that already exist. A named-user grant on a file is not enough if the user cannot traverse its parents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use a VM with getfacl and setfacl installed. This demonstrates policy on a fixture, not access through the private mktemp parent. The command uses the numeric ID of the local nobody account only for a lab fixture.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Grant, limit, and remove a named-user entry<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>getent passwd nobody\nlab=$(mktemp -d)\ncd &quot;$lab&quot; || exit\nprintf 'training report\\n' &gt; report.txt\nchmod 600 report.txt\nguest=$(id -u nobody)\nsetfacl -m &quot;u:$guest:rw-&quot; report.txt\nsetfacl -m m::r-- report.txt\ngetfacl -n report.txt\nsetfacl -x &quot;u:$guest&quot; report.txt\ngetfacl -n report.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># file: report.txt\n# owner: 1000\n# group: 1000\nuser::rw-\nuser:65534:rw-           #effective:r--\ngroup::---\nmask::r--\nother::---\n...\nuser::rw-\ngroup::---\nmask::---\nother::---<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Output omits the getent line and includes an illustrative numeric ID. After removing the named entry, the mask can still be present. Inspect the remaining entries rather than inferring that every access path is gone.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Compare a default ACL with the child&#8217;s access ACL<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir shared\nsetfacl -m &quot;d:u:$guest:r-x&quot; shared\ntouch shared\/new.txt\ngetfacl -cn shared | grep '^default:user:'\ngetfacl -cn shared\/new.txt | grep -E '^(user:[0-9]+:|mask::)'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>default:user::rwx\ndefault:user:65534:r-x\nuser:65534:r-x           #effective:r--\nmask::rw-<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The new regular file&#8217;s creation mode can limit inherited permissions. Removing the default entry on shared will not remove an ACL on new.txt.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>What does the mask mean for a named rw- grant?<\/li>\n\n\n<li>What is the difference between an access ACL and a default ACL?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Remove the named default ACL from shared without changing other entries.<\/li>\n\n\n<li>Why might the user still be unable to read the file after an ACL shows r&#8211;?<\/li>\n\n\n<li>Can removal of a named entry guarantee the user has no access? Explain.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>What does the mask mean for a named rw- grant?<\/strong><br><strong>Answer<\/strong> \u2014 Only the permitted intersection is effective. A mask of r&#8211; removes effective write.<\/li>\n\n\n<li><strong>What is the difference between an access ACL and a default ACL?<\/strong><br><strong>Answer<\/strong> \u2014 An access ACL is checked on its object. A default ACL can be inherited by new children.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Remove the named default ACL from shared without changing other entries.<\/strong><br><strong>Answer<\/strong> \u2014 setfacl -x &quot;d:u:$guest&quot; shared. Check the child separately.<\/li>\n\n\n<li><strong>Why might the user still be unable to read the file after an ACL shows r&#8211;?<\/strong><br><strong>Answer<\/strong> \u2014 A parent may lack traverse permission, or another policy such as SELinux may deny access.<\/li>\n\n\n<li><strong>Can removal of a named entry guarantee the user has no access? Explain.<\/strong><br><strong>Answer<\/strong> \u2014 No. Ownership, an owning-group rule, another group rule, or the others entry can independently matter. Check effective access as the intended user.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78680\">Linux: Regular Permissions (symbolic\/numeric) vs ACL<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78682\">Linux: setfacl remove a user completely<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78678\">Linux: ACL vs Selinux<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78688\">Special Permissions: SUID, SGID, sticky bit<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 01 \u2014 Users, Groups, sudo, and Special Permissions. Next lesson 03 \u2014 Bash Variables, Quoting, and Input.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1991\">Linux Intermediate category<\/a> \u00b7 Lesson 2 of 9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Grant and remove a narrowly scoped named-user ACL and distinguish a grant from effective access.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1991],"tags":[],"class_list":["post-79078","post","type-post","status-publish","format-standard","hentry","category-linux-intermediate","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79078,"position":0},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79077,"url":"http:\/\/bangla.sitestree.com\/?p=79077","url_meta":{"origin":79078,"position":1},"title":"Linux Intermediate 01 \u2014 Users, Groups, sudo, and Special Permissions","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Inspect identity records, understand sudo, and build a group-inheriting directory in a disposable VM.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79074,"url":"http:\/\/bangla.sitestree.com\/?p=79074","url_meta":{"origin":79078,"position":2},"title":"Linux Basics 06 \u2014 File Permissions and umask","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Read a permission string, predict umask results, and choose a minimal permission change.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79085,"url":"http:\/\/bangla.sitestree.com\/?p=79085","url_meta":{"origin":79078,"position":3},"title":"Linux Intermediate 09 \u2014 Block Devices, Filesystems, and Mounts","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Distinguish a block device from a filesystem and a mount point, and inspect each layer without changing it.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79088,"url":"http:\/\/bangla.sitestree.com\/?p=79088","url_meta":{"origin":79078,"position":4},"title":"Linux Advanced 03 \u2014 SELinux Contexts, Booleans, and Denials","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Diagnose ordinary permission and SELinux policy problems separately and set a persistent file context.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79084,"url":"http:\/\/bangla.sitestree.com\/?p=79084","url_meta":{"origin":79078,"position":5},"title":"Linux Intermediate 08 \u2014 SSH Keys, Host Identity, and File Transfer","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Verify an SSH host\u2019s identity, use a passphrase-protected key, and transfer a non-sensitive file.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79078"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79078\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79078"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}