1、系统安装时安装samba
2,在useradd -d /home/pub/-m pub上创建系统用户,并将密码设置为public
3、共享目录/home/pub/doc/
4、更改smb配置文件/etc/samba/smb.conf :
(1)注释掉[homes] )部分
)2)在文件末尾添加以下行:
[doc]
comment=all doc
path=/home/pub/doc/
valid users=pub
公共=否
writable=是
printable=no
5 )向samba中添加系统用户pub。 /usr/cxdcc/smbpasswd -a pub,将密码设置为pub。 此密码可以与系统用户的密码不同
6,防火墙设置:允许指定的ip段访问139端口和445端口,运行etc/init.d/iptables save并将其保存到配置式/etc/sysconfig/iptables
7,selinux设置: setenforce 0(如果启用系统重新启动,则需要修改配置文件/etc/selinux/config中的SELINUX=permissive ) ) ) )。
8、重新启动/etc/init.d/SMBrestartSMB服务(如果启用系统重新启动,则需要运行/scx DCC/chkconfig---- level 345 sm bon ) )
9、在windows运行框中,输入名为\centos-ip服务的共享文件夹。 用户名为: pub,密码为: pub