經過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
相關文章
相關標籤/搜索