1.安装Cent OS版本5.8,创建用户pc01,将用户pc01,添加到sudoer里面,修改/etc/sudoers,在root ALL=(ALL) ALL下添加pc01 ALL=(ALL) NOPASSWD:ALL2.运行yum -y install samba
3.编辑/etc/samba/smb.conf,参见相关文章,在[global]下添加
最后添加[public] comment = Public Stuff path = /home/samba browseable = yes public = yes writable = yes
4.创建samba目录
mkdir /home/samba chown -R pc01 /home/samba chmod 0777 /home/samba chcon -t samba_share_t /home/samba 5.添加pc01到samba用户中,并填写密码
smbpasswd -a pc016.将samba服务放入到防火墙里,修改/etc/sysconfig/iptables文件,在-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT下添加-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 137 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 138 -j ACCEPT运行/etc/rc.d/init.d/iptables restart7.运行chkconfigsmb on运行chkconfig --list smb 检查
8.启动samba/etc/rc.d/init.d/smb start或运行service smb start9.运行pgrep smbd或运行pstree | grep mbd,查看smb运行情况
10.win7运行secpol.msc,打开"本地策略"-"安全选项"-"网络安全:Lan Manager身份验证级别",选择为“发送 LM 和 NTLM – 如果已协商,则使用 NTLMv2 会话安全”