标签:samba
1.安装samba
yum install -y samba samba-client
2.增加samba用户
useradd -s yanfa /sbin/nologin pdbedit -a yanfa 然后输入用户名和密码 每个用户都得增加,密码是windows端登陆的密码。
3.修改samba的配置文件
[root@localhost tmp]# cat /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = Samba Server Version %v log file = /var/log/samba/log.%m max log size = 50 security = share passdb backend = tdbsam load printers = yes cups options = raw [home] comment = Home Directories browseable = no writable = yes [printers] comment = All Printers path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes [资料共享] comment = share path = /tmp/资料共享 browseable = yes public = yes writable = yes [采购部门] comment = welcome to caigou partment path = /tmp/采购部门 writable = yes valid users = caigou [研发部门] comment = welcome to yanfa path = /tmp/研发部门 writable = yes valid users = @yanfa write list = @yanfa [root@localhost tmp]#
[root@localhost tmp]# ll /tmp 总用量 20 drwxrwxrwx 3 root root 4096 6月 11 15:13 samba -rw------- 1 root root 3107 6月 10 18:32 yum_save_tx-2017-06-10-18-32CG9F5G.yumtx drwxr-xr-x 2 root root 4096 6月 11 15:47 采购部门 drwxrwx--- 2 yanfa yanfa 4096 6月 11 16:53 研发部门 drwxrwxrwx 2 root root 4096 6月 11 17:15 资料共享 [root@localhost tmp]#
1.
[资料共享] 这个是对应/tmp/资料共享 所有人都可以看,所以 要赋予777 的权限
chmod -R 777 /tmp/资料共享
2.
[研发部门] 这个对应的/tmp/下的研发部门,但是配置文件是@yanfa 组所有的用户都可以访问
所以
chown yanfa.yanfa /tmp/研发部门
chmod -R 770 /tmp/研发部门 #不让其它用户访问
可以看出yanfa用户和zhanghao用户都在一个组内 所以其都能访问这个目录
[root@localhost tmp]# cat /etc/passwd
yanfa:x:501:501::/home/yanfa:/sbin/nologin
zhanghao:x:503:501::/home/zhanghao:/sbin/nologin
[root@localhost tmp]# cat /etc/group
yanfa:x:501:
zhanghao:x:501:
本文出自 “砖家博客” 博客,请务必保留此出处http://wsxxsl.blog.51cto.com/9085838/1934267
标签:samba
原文地址:http://wsxxsl.blog.51cto.com/9085838/1934267