Tuesday, May 5, 2020

Setup Samba Server (Restricted Share Directory) On Linux Mint 19.3 Tricia / Ubuntu 20.04 LTS

Video Tutorial - https://youtu.be/rEstDzklyAQ

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(Restricted Share Directory)
For example, Create a share directory that requires user authentication.

Samba Server is one of the powerful servers that helps you to share files and printers with Windows-based and other operating systems.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Linux Mint 19.3 Tricia       Hostname - wwww.example.com     , ip Address - 192.168.1.10
Network interface name:- ens33

Ubuntu 20.04 LTS             Hostname - www.yourdomain.com  , ip Address - 192.168.1.10 
Network interface name:- ens33
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common samba
groupadd share ; mkdir /home/share ; chgrp share /home/share  ; chmod 770 /home/share
nano /etc/samba/smb.conf
unix charset = UTF-8    workgroup = WORKGROUP    interfaces = 127.0.0.0/8 ens33 192.168.1.0/24
bind interfaces only = yes

[share]
    path = /home/share
    writable = yes
    create mode = 0770
    directory mode = 0770
    guest ok = no
    # allow users only in [share] group
    valid users = @share

useradd smbuser
smbpasswd -a smbuser
usermod -G share smbuser ; systemctl restart smbd ; systemctl status smbd ; hostname -I
\\192.168.1.30\share
ls /home/share/

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment