{"id":1894,"date":"2021-04-14T21:30:28","date_gmt":"2021-04-14T21:30:28","guid":{"rendered":"https:\/\/dft.wiki\/?p=1894"},"modified":"2026-04-21T13:34:31","modified_gmt":"2026-04-21T17:34:31","slug":"samba-sharing-with-ad-permissions-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=1894","title":{"rendered":"SAMBA Sharing with AD Permissions on Ubuntu"},"content":{"rendered":"<p>This post is a continuation of the posts:<\/p>\n<ul>\n<li>Linux as AD-DC Principal [<a href=\"https:\/\/dft.wiki\/?p=220\">Link<\/a>],<\/li>\n<li>Linux as AD-DC Replication [<a href=\"https:\/\/dft.wiki\/?p=1910\">Link<\/a>],<\/li>\n<li>Joining Ubuntu 20.04 to Domain [<a href=\"https:\/\/dft.wiki\/?p=1899\">Link<\/a>].<\/li>\n<\/ul>\n<p>Assuming you have set up and joined an instance of Ubuntu Server to the domain follow the instructions below to create a Windows Share and apply the privileges from the Active Directory to users and groups.<\/p>\n<hr \/>\n<p><strong>SAMBA CONFIG<\/strong><\/p>\n<pre class=\" prettyprinted\"><span class=\"pln\">sudo apt update\r\nsudo apt install samba winbind libpam-winbind libnss-winbind krb5-config <\/span><span class=\"pun\">-<\/span><span class=\"pln\">y\r\nsudo ufw allow samba\r\n<\/span><\/pre>\n<p>Create the directory to be shared:<\/p>\n<pre>mkdir \/shared\r\nmkdir \/user1\r\nchmod -R 777 \/shared\r\nchmod -R 777 \/user1 \r\nnano \/etc\/samba\/smb.conf<\/pre>\n<p>Create the Windows share:<\/p>\n<pre>[shared]\r\n        comment = \"Shared Files\"\r\n        path = \/shared\r\n        valid users = \"@Domain Users\"\r\n        writable = yes\r\n        read only = no\r\n        force create mode = 0660\r\n        create mask = 0777\r\n        directory mask = 0777\r\n        force direectory mode = 0770\r\n        access based share enum = yes\r\n        hide unreadable = yes\r\n\r\n[user1]\r\n        comment = \"User1 Files\"\r\n        path = \/user1\r\n        valid users = \"user1\"\r\n        writable = yes\r\n        read only = no\r\n        force create mode = 0660\r\n        create mask = 0777\r\n        directory mask = 0777\r\n        force direectory mode = 0770\r\n        access based share enum = yes\r\n        hide unreadable = yes\r\n<\/pre>\n<p>Restart the AD-DC:<\/p>\n<pre>systemctl restart samba-ad-dc.service<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post is a continuation of the posts: Linux as AD-DC Principal [Link], Linux as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-1894","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1894"}],"version-history":[{"count":12,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1894\/revisions"}],"predecessor-version":[{"id":5487,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1894\/revisions\/5487"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}