centos 6.5搭建Samba

Samba共享服务器
先将selinux关闭和防火墙端口号打开 139 445
#iptables -A INPUT -p udp -dport 137 -j ACCEPT
#iptables -A INPUT -p udp -dport 138 -j ACCEPT
iptables -A INPUT -p tcp -dport 139 -j ACCEPT
iptables -A INPUT -p tcp -dport 445 -j ACCEPT
Yum -y install samba samba-common
Mkdir /home/share 创建共享目录
Chmod 777 /home/share

cd /etc/samba
cp smb.conf smb.conf.bak

vim smb.conf
[global]
        workgroup = SAMBA
        security = user

        passdb backend = tdbsam
#unix charset = utf8
#dos charset = GB2312 中文字符
        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw
        map to guest =Bad User  #设置共享
#[printers]
#       comment = All Printers
#       path = /var/tmp
#       printable = Yes
#       create mask = 0600
#       browseable = No
#
#[print$]
#       comment = Printer Drivers
#       path = /var/lib/samba/drivers
#       write list = root
#       create mask = 0664
#       directory mask = 0775
[share]
        comment = share
        path = /home/share 
        writeable = no #共享是否写入
        browseable = yes #是否可见
        guest ok = yes  #免密码访问

systemctl restart smb.service

Windows端 win+R输入\\ip

猜你喜欢

转载自www.cnblogs.com/Liang-jc/p/8917448.html