|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!情况先容:
1、装置前筹办
1)selinux(或间接disable)
[root@smb~]setsebool-Psamba_enable_home_dirson
[root@smb~]setsebool-Psamba_export_all_rwon
2)iptables
[root@smb~]skip...................
3)体系目次及用户与组创立(寄望巨细写)
[root@smb~]mkdir-pv/smb/{Sales,Develop,Public}
[root@smb~]groupaddops
[root@smb~]useradd-Gops-s/sbin/nologinzhang3
[root@smb~]groupadddevelop
[root@smb~]useradd-Gdevelop-s/sbin/nologinli4
[root@smb~]groupaddBoss
[root@smb~]useradd-GBoss-s/sbin/nologinwang5
[root@smb~]groupaddsales
[root@smb~]useradd-Gsales-s/sbin/nologinzhao6
[root@smb~]chmod1777/smb/{Sales,Develop}
[root@smb~]chmod1777/smb/Public
[root@smb~]chgrpsales/smb/Sales
[root@smb~]chgrpdevelop/smb/Develop
[root@smb~]chgrpops/smb/Public
2、装置
[root@smb~]yum-yinstallsambasamba-client#client能够不装
3、设置主文件
[root@smb~]vi/etc/samba/smb.conf
#=============================GlobalSetting=============================
workgroup=WORKGROUP
serverstring=SambaServerVersion%v
netbiosname=SHAREFILESERVER
guestaccount=nobody
displaycharset=UTF-8
unixcharset=UTF-8
doscharset=cp936
encryptpasswords=yes
smbpasswdfile=/etc/samba/smbpasswd
usernamemap=/etc/samba/smbusers
oslevel=40
localmaster=yes
preferredmaster=yes
;inte***ces=loeth0192.168.12.2/24192.168.13.2/24
;hostsallow=127.192.168.12.192.168.13.
maxlogsize=50
security=user
passdbbackend=tdbsam
cupsoptions=raw
disablespoolss=yes
loadprinters=no
printing=bsd
printcapname=/dev/null
#=============================GlobalSetting=============================
;[homes]
;comment=HomeDirectories
;browseable=no
;writable=yes
;validusers=%S
;validusers=MYDOMAIN\%S
[Sales]
path=/smb/Sales
comment=SalesDepartShareFolder
browseable=yes
guestok=no
writeable=no
validusers=@sales,@Boss
writelist=@sales
[Develop]
path=/smb/Develop
comment=DevelopDepartShareFolder
browseable=yes
guestok=no
writeable=no
validusers=@develop
writelist=@develop
[Public]
path=/smb/Public
comment=PublicShareFolder
browseable=yes
guestok=no
writeable=no
validusers=@develop,@Boss,@sales
adminusers=zhang3
writelist=@ops
invalidusers=root
4、添置用户及设置暗码
1)经由过程smbpasswd
[root@smb~]smbpasswd-azhang3[/quote]2)经由过程pdbedit
[root@smb~]pdbedit-ali4pdbedit–ausername:新建Samba账户。
pdbedit–xusername:删除Samba账户。
pdbedit–L:列出Samba用户列表,读取passdb.tdb数据库文件。
pdbedit–Lv:列出Samba用户列表的具体信息。
pdbedit–c“[D]”–uusername:停息该Samba用户的账号。
pdbedit–c“[]”–uusername:规复该Samba用户的账号。
客户端上岸形态
[root@smb~]smbstatus
Linux客户端毗连(回车间接检察)
[root@smb~]smbclient-L//192.168.109.237/Public
[root@smb~]smbclient-Uzhang3//192.168.109.237/Public
smbclient-Uzhang3//192.168.109.237/Public
Enterzhang3spassword:
Domain=[WORKGROUP]OS=[Unix]Server=[Samba3.6.9-169.el6_5]
smb:>help
挂载
[root@smb~]mount-tcifs//192.168.109.237/Pulic/mnt/smb/Public-ousername=zhang3,password=<password>如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|