Samba快捷匿名访问设立

Samba快捷匿名访问设置

主要步骤有3:

1,开通需要开通的防火墙端口,tcp139,tcp455,udp137,udp138

vi /etc/sysconfig/iptables
增加(或确认存在)一下记录
#NetBIOS
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT 
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT 
#Samba
-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

 

2,配置samba:

[root@lan ~]#yum -y install samba
[root@lan ~]#mkdir /home/share
[root@lan ~]#chmod 777 /home/share

[root@lan ~]#vi /etc/samba/smb.conf
# near line 58: add

unix charset = UTF-8

dos charset =GBK
# line 75: change (Windows' default)

workgroup =WORKGROUP
# line 81: uncomment and change IP address you allow

hosts allow = 127.10.0.0.
# line 102: change (no auth)

security =share
# add at the bottom

[Share]
# any name you like

   path = /home/share # shared directory
   writable = yes  # writable
   guest ok = yes # guest OK
   guest only = yes # guest only
   create mode = 0777 # fully accessed
   directory mode = 0777 # fully accessed
   share modes = yes # warn if some people access to a file

 

[root@lan ~]# /etc/rc.d/init.d/smb start
Starting SMB services:[  OK  ]
[root@lan ~]#/etc/rc.d/init.d/nmb start
Starting NMB services:[  OK  ]
[root@lan ~]#chkconfig smb on
[root@lan ~]#chkconfig nmb on

 

3, 如果是W7,W2008,还有一个地方需要单独修改:"从Vista开始,微软默认只采用NTLM v2协议的认证回应消息了,而目前的NAS系统和Samba还只支持LM或者NTLM",所以需要按照网上介绍的办法,见附图

 

参考链接:

http://396175583.blog.51cto.com/4074252/736431

http://www.server-world.info/en/note?os=CentOS_6&p=samba

http://wenku.baidu.com/view/1d2557c789eb172ded63b715.html