1、应用场景;
2、安装配置;
3、遇到问题与解决方案;
4、Samba知识点;
linux和windows都可以访问的文件服务器;
准备工作:
OS:CentOS release 6.9 (Final)
Samba版本:samba4.2.10-15.el6
关闭防火墙和Selinux:
service iptables stop
setenforce 0
安装步骤:
配置文件:
#vim /etc/samba/smb.conf
#================ Global Settings=======================
#================ Share Definitions ======================
;[homes] #注释homes所有项;
; comment = Home Directories
; browseable = no
; writable = no
; valid users = %S
; valid users = MYDOMAIN\%S
;[printers] #注释printers所有项;
; comment = All Printers
; path = /var/spool/samba
; browseable = no
; guest ok = no
; writable = no
; printable = no
#samba4共享目录设定:
系统用户,samba用户和共享目录配置:
测试共享目录:
windows客户端测试:打开运行输入 \ip 直接访问
test01 可以写入共享目录;
test02 可以读取工项目;
=====================================================
检查samba配置文件报错提示:
testparm -v
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
解决方法:
vim /etc/security/limits.conf
add line:
root - nofile 16384
("root"是一个用户,如果是想所有用户生效的话换成"*")
#reboot ####重新启动计算机;
启动计算机后重新验证samba配置文件启动服务。
=======================================================
1、共享目录权限由linux系统目录本身权限+samba配置文件中权限共同作用;
2、samba.conf分为三部分:
[global]
[homes]
[printers]
3、samba服务器有四种验证方式:
share 不需要用户名密码;
user 授权用户访问;
server 通过认证服务器身份验证;
domain 域控制器身份验证;
配置文件项:
security = user #samba服务器的验证方式;
=====================================================
原文:https://blog.51cto.com/1428971/2371325