CentOS 6.2 安装samba

yum install samba system-config-samba samba-client samba-common
mkdir -p /data0/public/
chmod 777 /data0/public/

mv -f /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf

输入以下内容:
[global]
server string = Samba Server
security = share
hosts allow = 127.0.0.1 192.168.0.0/24 192.168.1.0/24
hosts deny = 0.0.0.0/0

[public]
path = /data0/public
public = yes
guest ok = yes
create mode = 0777
directory mode = 0777
browseable = yes
writable = yes
security = share

/sbin/service smb start

Samba服务所使用的端口和协议: 


    * Port 137 (UDP) - NetBIOS name service and nmbd
    * Port 138 (UDP) - NetBIOS datagram service
    * Port 139 (TCP) - File and printer sharing and smbd
    * Port 389 (TCP) - for LDAP (Active Directory Mode)
    * Port 445 (TCP) - NetBIOS was moved to 445 after 2000 and beyond, (CIFS)
    * Port 901 (TCP) - for SWAT

开放防火墙:
/sbin/iptables -I INPUT -p udp --dport 137 -j ACCEPT
/sbin/iptables -I INPUT -p udp --dport 138 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 139 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 389 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 445 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 901 -j ACCEPT
service iptables save


关闭SELinux,不然会出现"您可能没有权限使用网络资源"的问题
setenforce 0
如果要启用,可以使用setenforce 1

这样就可以在win中使用\\x.x.x.x进行共享访问了

断开 samba ,运行:

net use * /del

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值