码迷,mamicode.com
首页 > 其他好文 > 详细

centos 7 .2 安装samba服务器

时间:2018-07-24 17:36:03      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:用户   ons   director   创建   str   directory   read   comm   tmp   

1、yum -y install samba
2、添加系统用户
useradd smbuser
3、系统用户加入到smb数据中
pdbedit -a smbuse
4、会提示设置密码,输入一个密码
5、查看创建的用户
pdbedit -L
6、配置smb.conf
[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
[data]
path=/data/
; public=yes
; browseable=yes|no
; read only=yes|no
; writeable = yes|no
write list = smbuser
valid users = smbuser
; host allow =
; host deny =
; comment = ‘share file‘

7、创建目录/data
mkdir /data
8、目录赋予用户权限
setfacl -m u:smbuser:rwx /data
9、chown -Rv smbuser:smbuser data/
10、chmod -Rv 755 data
11、重启smb
systemctl restart smb

linux客户端设置
1、安装cifs
yum -y install cifs-utils
2、创建/data目录
mkdir /data
3、挂载目录
mount -t cifs //172.16.1xx.xxxx/data /data -o username=smbxxx.password=smbxxxxx

centos 7 .2 安装samba服务器

标签:用户   ons   director   创建   str   directory   read   comm   tmp   

原文地址:http://blog.51cto.com/nhylovezyh/2149552

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!