标签:samba
首先使用yum安装
yum install samba samba-client samba-swat
起服务
service smb start chkconfig --level 3 smb on
按部门创建用户
useradd -s /sbin/nologin gm useradd -s /sbin/nologin hr useradd -s /sbin/nologin dd useradd -s /sbin/nologin od useradd -s /sbin/nologin pd useradd -s /sbin/nologin bd useradd -s /sbin/nologin fd useradd -s /sbin/nologin md
设置密码
smbpasswd -a gm smbpasswd -a hr smbpasswd -a dd smbpasswd -a od smbpasswd -a pd smbpasswd -a bd smbpasswd -a fd smbpasswd -a md
创建目录并修改权限
mkdir GM mkdir HR mkdir DD mkdir OD mkdir PD mkdir BD mkdir FD mkdir MD mkdir public chown gm:gm GM chown hr:hr HR chown dd:dd DD chown od:od OD chown pd:pd PD chown fd:fd FD chown bd:bd BD chown md:md MD
vim /etc/samba/smb.conf修改配置
[global] workgroup = MYGROUP server string = Samba Server Version %v log file = /var/log/samba/log.%m max log size = 50 security = user passdb backend = tdbsam load printers = yes cups options = raw [总经办] comment = 总经办 path = /data3/GM public = no admin users = gm valid users = gm writable = yes [人事行政部] comment = 人事行政部 path = /data3/HR public = no admin users = hr valid users = hr writable = yes [市场部] comment = 市场部 path = /data3/MD public = no admin users = md valid users = md writable = yes [研发部] comment = 研发部 path = /data3/DD public = no admin users = dd valid users = dd writable = yes [运维部] comment = 运维部 path = /data3/OD public = no admin users = od valid users = od writable = yes [产品部] comment = 产品部 path = /data3/PD public = no admin users = pd valid users = pd writable = yes [财务部] comment = 财务部 path = /data3/FD public = no admin users = fd valid users = fd writable = yes [业务拓展部] comment = 业务拓展部 path = /data3/BD public = no admin users = bd valid users = bd writable =yes [public] comment = This is a share directory. path = /data3/public write list= gm,hr,dd,od,pd,fd,bd,md writable = yes
service smb reload重新载入
这样各部门只能访问自己部门的目录,public的目录每个部门都可以访问。
标签:samba
原文地址:http://bzlbc.blog.51cto.com/8590656/1684799