# 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 #samba的工作组,设置成 Windows 的工作组 security = user #安全选项,可以是 share|user|server|domain,安全级别递增 passdb backend = tdbsam #定义口令类型,存在如下3中口令校验 #smbpasswd:使用smbpasswd命令为系统用户设置Samba服务程序的密码 #tdbsam:创建数据库文件并使用pdbedit命令建立Samba服务程序的用户 #ldapsam:基于LDAP服务进行账户验证 printing = cups printcap name = cups load printers = yes #设置在Samba服务启动时是否共享打印机设备 cups options = raw #打印机的选项
[root@master ~]# getsebool -a | grep samba samba_create_home_dirs --> off samba_domain_controller --> off samba_enable_home_dirs --> off samba_export_all_ro --> off samba_export_all_rw --> off samba_load_libgfapi --> off samba_portmapper --> off samba_run_unconfined --> off samba_share_fusefs --> off samba_share_nfs --> off sanlock_use_samba --> off tmpreaper_use_samba --> off use_samba_home_dirs --> off virt_use_samba --> off [root@master ~]# setsebool -P samba_enable_home_dirs on
# # /etc/fstab # Created by anaconda on Sun Jan 27 21:25:27 2019 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/centos-root / xfs defaults 0 0 UUID=3acaf9d0-4cd0-40d0-af57-c84cd23fec0c /boot xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 //192.168.1.20/rootdir /database cifs credentials=/root/auth.smb 0 0