You are on page 1of 2

https://websiteforstudents.

com/create-private-samba-share-ubuntu-17-04-17-10/
https://www.liberiangeek.net/2014/07/create-configure-samba-shares-centos-7/
STEP 1: INSTALL SAMBA

sudo apt-get update


sudo apt-get install samba

STEP 2: CREATE THE SHARE

sudo mkdir /home/Private

STEP 3: CREATE A PRIVATE GROUP

sudo groupadd security

sudo chgrp security /home/Private


sudo chmod -R 0770 /home/Private

STEP 4: CONFIGURE SAMBA

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no
bind interfaces only = yes

# add to the end


[Private]
path = /home/Private
writable = yes
guest ok = no
read only = no
browsable = yes
create mode = 0777
directory mode = 0777
valid users = @security

ejemplo 2

[andres]
path = /home/andres
writable = yes
guest ok = no
read only = no
browsable = yes
create mode = 0777
directory mode = 0777
valid users = @Sistemas

# agregar la carpeta en le selinux para que funcione si no no deja crear


chcon -t samba_share_t /home/andres/

comando auxiliare de ayuda


cut -d: -f1 /etc/passwd

STEP 5: ADD MEMBERS TO GROUP


sudo groupadd Sistemas

sudo adduser -M andres # la M para que no cree home directory

sudo adduser andres

sudo smbpasswd -a andres

sudo usermod -a -G Sistemas andres

sudo systemctl restart smbd

#add user without home folder


sudo adduser -M tools -g Sistemas
sudo smbpasswd -a pablo

#To enable XP clients on later Fedora systems, add these directives to the [global]
section of your /etc/samba/smb.conffile:
lanman auth = yes
ntlm auth = yes

You might also like