1. 安装软件
yum install samba samba-client samba-swat
2. 修改samba配置文件
vi /etc/samba/smb.conf
修改
workgroup = hitachigst.globalnetbios name = hitachigst.global[all]comment = Public Stuffpath = /home/lbl/allavailable = yesbrowseable = yespublic = yeswritable = yesPRintable = nowrite list = lblguest ok = no
3. 添加samba用户
touch /etc/samba/smbpasswdsmbpasswd -a lbl
4. 修改共享目录的访问权限
chmod 777 -R /home/lbl/allchcon -R -t samba_share_t /home/lbl/all#编辑/etc/rc.local,末尾加入/usr/bin/chcon -t samba_share_t /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
新闻热点
疑难解答