This post is a continuation of the posts:
- Linux as AD-DC Principal [Link],
- Linux as AD-DC Replication [Link],
- Joining Ubuntu 20.04 to Domain [Link].
Assuming you have set up and joined an Ubuntu Server instance to the domain, follow the instructions below to create a Windows Share and apply Active Directory privileges to users and groups.
SAMBA CONFIG
sudo apt update sudo apt install samba winbind libpam-winbind libnss-winbind krb5-config -y sudo ufw allow samba
Create the directories to be shared:
mkdir /shared mkdir /user1 chmod -R 777 /shared chmod -R 777 /user1 nano /etc/samba/smb.conf
Add the following Windows share definitions:
[shared]
comment = "Shared Files"
path = /shared
valid users = "@Domain Users"
writable = yes
read only = no
force create mode = 0660
create mask = 0777
directory mask = 0777
force directory mode = 0770
access based share enum = yes
hide unreadable = yes
[user1]
comment = "User1 Files"
path = /user1
valid users = "user1"
writable = yes
read only = no
force create mode = 0660
create mask = 0777
directory mask = 0777
force directory mode = 0770
access based share enum = yes
hide unreadable = yes
Restart the AD-DC:
systemctl restart samba-ad-dc.service