通过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


转载于:https://juejin.im/post/5c96e4a0f265da611b1ed875

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值