1. 安裝軟件
yum install samba samba-client samba-swat
2. 修改samba配置文件
vi /etc/samba/smb.conf
修改
workgroup = hitachigst.global
netbios name = hitachigst.global
[all]
comment = Public Stuff
path = /home/lbl/all
available = yes
browseable = yes
public = yes
writable = yes
printable = no
write list = lbl
guest ok = no
3. 添加samba用戶
touch /etc/samba/smbpasswd
smbpasswd -a lbl
4. 修改共享目錄的訪問權限
chcon -R -t samba_share_t /home/lbl/all
chmod 777 -R /home/lbl/all
5. 修改iptables開放samba端口
vi /etc/sysconfig/iptables
在“ACCEPT”下一行加入
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
-A INPUT -p udp -m udp --dport 137 -j ACCEPT
-A INPUT -p udp -m udp --dport 138 -j ACCEPT
重啟服務
/etc/rc.d/init.d/iptables restart
6. 重啟samba服務
/etc/init.d/smb restart
/etc/init.d/nmb restart