CentOS7 Samba 相關設置

windows 10 清除緩存共享的用戶名和密碼
cmd > net stop workstation

[root@localhost]mkdir -p /ABC/{ops,sales,share}

[root@localhost ABC]yum install samba -y

[root@localhost ABC]groupadd ops
[root@localhost ABC]groupadd sales
[root@localhost ABC]groupadd share

[root@localhost ABC]useradd -s /sbin/nologin ops
[root@localhost ABC]useradd -s /sbin/nologin sales
[root@localhost ABC]useradd -s /sbin/nologin share

[root@localhost ABC]#smbpasswd -a ops
123456
123456
[root@localhost ABC]#smbpasswd -a sales
123456
123456
[root@localhost ABC]#smbpasswd -a share
123456
123456

[root@localhost ABC]# chown ops:ops ops
[root@localhost ABC]# chmod 770 ops
[root@localhost ABC]# chown sales:sales sales
[root@localhost ABC]# chmod 770 sales
[root@localhost ABC]# chown share:share share
[root@localhost ABC]# chmod 777 share

[root@localhost ABC]# systemctl restart smb

[root@localhost ABC]# cat /etc/samba/smb.conf

See smb.conf.example for a more detailed config file or

read the smb.conf manpage.

Run 'testparm' to verify the config is correct after

you modified it.

[global]
workgroup = SAMBA
security = user

    passdb backend = tdbsam

    printing = cups
    printcap name = cups
    load printers = yes
    cups options = raw

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775

#[common]

comment = Common share

path = /common

browseable = yes

writable = yes

#[smbtest]

comment = Common share

path = /smbtest

browseable = yes

writable = yes

[ops]
comment = ops share
path = /ABC/ops
browseable = yes
valid user = ops
writable = yes
guest ok = no
write list = ops
[sales]
comment = sales share
path = /ABC/sales
browseable = yes
valid user = sales
writable = yes
guest ok = no
write list = sales
[share]
comment = share
path = /ABC/share
browseable = yes
valid user = share
writable = yes
guest ok = yes
write list = share

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章