1、安裝SAMBA
yum -y install samba samba-client samba-common
2、修改文件打開數
vi /etc/security/limits.conf 最后添加 * soft nofile 65535 * hard nofile 65535
(需重啟機器)
3、配置SAMBA
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak #備份 vi/etc/samba/smb.conf 修改為: [global] log file = /var/log/samba/log.%m max log size = 50 security = user map to guest = Bad User#實現無密碼訪問 [PyDoc] path=/root/PythonProject readonly=yes browseable=yes writable = yes guest ok=yes
4、關閉防火牆
systemctl stop firewalld
systemctl disable firewalld
5、關閉SELinux
修改配置文件需要重啟機器: vi /etc/selinux/config 將SELINUX=enforcing 改為SELINUX=disabled (需重啟機器)
5、測試配置文件
testparm
6、啟動SAMBA
systemctl restart smb #重啟
systemctl enable smb #修改為開機啟動
systemctl status smb #查看狀態
7、在windows下輸入\\192.168.49.200訪問
8、解決win10無法訪問共享文件夾
a、開啟網絡發現
b、開啟SMBv1 To enable SMBv1 on the SMB client, run the following commands: sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi sc.exe config mrxsmb10 start= auto
c、關閉SMBv2 and SMBv3
To disable SMBv2 and SMBv3 on the SMB client, run the following commands:
sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi
sc.exe config mrxsmb20 start= disabled
(需要重啟win)
