经过samba服务让windows访问linux服务器

配置参考:
安装教程参考连接:
sambal知识点参考连接: www.linuxidc.com/Linux/2015-…
心得:我要在个人windows上共享centos7的文件,作法以下:


1.在/etc/samba/目录下先备份smb.conf: cp -rf smb.conf smb.conf.bk
2.vi smb.conf,编辑以下内容:
# 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 = WORKGROUP
security = user
ntlm auth = yes
encryptpasswords=yes
public=yes
smbpasswdfile=/etc/samba/smbpasswd
passdb backend = smbpasswd

printing = cups
printcap name = cups
load printers = yes
cups options = raw
[home]
path=/root
validusers=root
public=yes
writable=yes

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
3.添加用户:
smbpasswd -a ${username}
4.启动smb并设置开机启动:
systemctl start smb
selinux的屏蔽,
centos7关闭防火墙:systemctl stop firewalld.service
关闭seliunx:
永久关闭:
vim /etc/sysconfig/selinux
SELINUX=enforcing 改成 SELINUX=disabled
而后重启服务
注意事项:
当windows访问samba提示拒绝访问时是由于Linux的防火墙和selinux的过滤形成的,将二者关闭便可,另外,samba4.6.2以后的版本已经默认关闭了ntlm的协议了,会对windows7形成访问失败,具体的现象是网络密码不正确或者windows没法访问网络。解决方法就是在[global]中添加ntlm auth = yes
相关文章
相关标签/搜索