May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Centos 7 Samba

Centos 7 Samba

FILEDOC /samba/docs
LEARDOCS /samba/tech

rpm -qi samba

mkdir -p /samba/docs
mkdir -p /samba/tech

ulimit -n 16384

vi /etc/security/limits.conf
* – nofile 16384

cd /etc/samba/

cp smb.conf smb.conf.origin

[global]
workgroup=FILESERVER
netbios name=SERVER1
server string=Samba Server
#security=share
security=user
map to guest = Bad User
[SHAREDOCS]
path=/samba/tech
readonly=yes
browseable=yes
guest ok=yes
[TECHDOCS]
path =/samba/tech
public = no
writable = yes
write list = @GROUP1
validusers = @GROUP1

useradd test1
useradd test2
useradd test3
useradd GROUP1

useramod -a -G GROUP1 test1
useramod -a -G GROUP1 test2
useramod -a -G GROUP1 test3

smbpasswd -a test1
smbpasswd -a test2
smbpasswd -a test3

chown GROUP1:GROUP1 /samba/tech
chmod 770 /samba/tech

ll -d /samba/tech

systemctl restart smb
systemctl enable smb
systemctl status smb

# smbclient-L localhost -U test1%P@ssw0rd
Domain=[FILESERVER] OS=[Unix] Server=[Samba 4.1.1]

Sharename Type Comment
——— —- ——-
SHAREDOCS Disk
TECHDOCS Disk
IPC$ IPC IPC Service (Samba Server)

Domain=[TECHDOCS] OS=[Unix] Server=[Samba 4.1.1]

Server Comment
——— ——-

Workgroup Master
——— ——-

C:\>netuse * /del

\\192.168.1.18\d$

C:\>netuse \\192.168.1.13 P@ssw0rd /U:test1

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>