How to configure and Install Samba on Ubuntu 20.04 Part2 Private Share
– How to configure and Install Samba on Ubuntu 20.04 Part2 Private Share https://youtu.be/6s9ZEp3xS94
– How to Install and configure Samba on Ubuntu 20.04 Part 1: Public folder https://youtu.be/2o5zgA8ml38
Configure Samba Private Share
Now you know how to create Samba public shares, let’s go and create private and protected shares. Only users that are member of the approved group will be able to access the secure location with passwords.
First create a samba group called smbgroup for the share.. only members will have access. To create a groups in Ubuntu, run the commands below.
– Create group:
$ sudo groupadd AdminTeam
$ sudo groupadd TechTeam
$ sudo groupadd SaleTeam
$ cat /etc/group
– Add user:
$ sudo useradd -s /usr/sbin/nologin admin1
$ sudo useradd -s /usr/sbin/nologin tech1
$ sudo useradd -s /usr/sbin/nologin tech2
$ sudo useradd -s /usr/sbin/nologin saler1
$ sudo useradd -s /usr/sbin/nologin saler2
– Add user to Group:
$ sudo usermod -aG AdminTeam,TechTeam,SaleTeam admin1
$ sudo usermod -aG TechTeam tech1
$ sudo usermod -aG TechTeam tech2
$ sudo usermod -aG SaleTeam saler1
$ sudo usermod -aG SaleTeam saler2
– Finally, all users who need to access a protected samba share will need to type a password. To add a user to samba password database, run the commands below for each user:
The user will be prompted to enter and confirm a password. This password will be used to access the protected samba shares.
$ sudo smbpasswd -a admin01
$ sudo smbpasswd -e admin01
$ sudo smbpasswd -a tech01
$ sudo smbpasswd -e tech01
$ sudo smbpasswd -a saler01
$ sudo smbpasswd -e saler02
– Show user and group:
$ sudo cat /etc/password
$ sudo cat /et/group
– Next, go and create Admin, Techical, Sale folder share in the /data directory.
$ sudo mkdir -p /data/Admin
$ sudo mkdir -p /data/Tecnical
$ sudo mkdir -p /data/Sale
– Then give only root and members group access to this share.
$ sudo cd /data/
$ sudo chown -R root:AdminTeam Admin
$ sudo chmod -R 2770 Admin
$ sudo chown -R root:TechTeam Tecnical
$ sudo chmod -R 2770 Tecnical
$ sudo chown -R root:saleTeam Sale
$ sudo chmod -R 2770 Sale
– When you’re done creating the folder share, go and share it in the smb.conf file.
# sudo nano /etc/samba/smb.conf
Then add configuration block below into smb.conf file just below the one above
[Admin]
comment = Everyone in the AdminTeam
path = /data/Admin
browseable = yes
read only = no
force create mode = 0660
force directory mode = 2770
valid users = @AdminTeam
[Technical]
comment = Everyone in the TechTeam and admin1
path = /data/Technical
browseable = yes
read only = no
force create mode = 0660
force directory mode = 2770
valid users = @TechTeam
[Sale]
comment = Everyone in the SaleTeam and admin1
path = /data/Sale
browseable = yes
read only = no
force create mode = 0660
force directory mode = 2770
valid users = @SaleTeam
[Accountant]
comment = Everyon in the AccTeam full and admin1 only read
path = /data/Accountant
browseable = yes
read only = yes
force create mode = 0665
force directory mode = 2775
valid users = @AccTeam @AdminTeam
write list = @AccTeam
Save your changes and you’re done.
Restart Samba and test your changes.
$ sudo systemctl restart smbd
$ sudo systemctl restart nmbd
_______SUBSCRIBE TO THIS HTU CHANNEL!_______
If you like the video, why not subscribe, so you won’t miss future videos!
Subscribe Here: https://www.youtube.com/channel/UCwxMCQV019yan9qL3BgyT3g?sub_confirmation=1
📚📚 Learn more about Tuts 📚📚
How to install Ubuntu Server 20 04 LTS – https://youtu.be/x4Nf2fTA22k
How to Install CentOS 8 Core – https://youtu.be/NeQqFBYTbsA
How To Install CentOS 7 Core https://youtu.be/47Lx1-CnBAM
____________________________________________
📺Playlists:
macOS Tips: – https://www.youtube.com/watch?v=O6kjRirgc6k&list=PLuhXGJTh9FwEzLrS74FcDdyc7Yda2PSV-
Windows 10 Tips: – https://youtube.com/playlist?list=PLuhXGJTh9FwGODDmjB6d9O6wrU0mDds9_
Linux Installs: – https://youtube.com/playlist?list=PLuhXGJTh9FwGGTS6HIh1tfx3SD05PQOrC
Bash shell script tutorial: – https://youtube.com/playlist?list=PLuhXGJTh9FwFNzwFwrhnccw5conMlV-OI
📺Latest Videos:
How to install HP LaserJet P2035n on Windows 10 – https://youtu.be/XYHvKqxtIrQ
How To install Wireshark on Windows 10 and macOS – https://youtu.be/g1FmqiDYryU
How to install Photoshop CC 2021 on Windows 10 – https://youtu.be/0QfJWLbuDB4
How to change the mouse pointer size and color in Windows 10 – https://youtu.be/4sxjt16SjSU
How to Install WiFi Explorer Pro Pro-level tool for Wi Fi diagnostics – https://youtu.be/FqTnF4dKBOg
_____________________________________________
Useful Links/Commands:
#linux #tutorial #macOS #Windows #Printer #Camera #CCNA #Graphic
Thank You For Watching and please visit my channel
Blog: http://howtoused.blogspot.com
YouTube Channel: http://youtube.com/howtoused
centos 7