<meta charset="utf-8">
1、安裝samba所需依賴包
[root@server ~]# yum -y install samba samba-common samba-client samba-swat
2、設(shè)置開機(jī)啟動
[root@server ~]# chkconfig --level 35 smb on
3、將137 138 139 445 端口加入防火墻規(guī)則
4、創(chuàng)建組及用戶
[root@server /]# groupadd share //創(chuàng)建組
[root@server /]# useradd -g share share01 //創(chuàng)建用戶并添加到組
[root@server /]# usermod -a -G share share01//將用戶添加到多個組
[root@server /]# pdbedit -a -u share01 //創(chuàng)建用戶密碼
[root@server /]# mkdir /share
[root@server /]# chmod 777 /share
5、編輯配置文件
[root@server ~]# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
[root@server ~]# vi /etc/samba/smb.conf
[share]
comment = Public Stuff
path = /share
public = yes
writable = yes
printable = no
write list = share01
6、重啟smb
[root@server /] service smb restart
[root@server /] service nmb restart
此時samba服務(wù)器就搭建好了,接下來 在windows端輸入IP進(jìn)行訪問

image.png
如果是windows10系統(tǒng)的話,可能會遇到無法訪問的情況,請啟用SMB1.0

image.png