centos7 安装samba

原文:https://www.howtoforge.com/samba-server-installation-and-configuration-on-centos-7
java

本身模拟了一遍能够使用就中文说明了。ios

windows必须在同一个工做组里。windows

net config workstation


设置匿名访问-不须要账号密码验证centos

  1. 先安装samba安全

yum install samba samba-client samba-common

2.查看已安装的samba服务centos7

rpm -qa|grep samba

3.编辑/etc/samba/smb.conf 最好先cp备份一下spa

mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.con
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ============================== 
[Anonymous] #这个名字就是windows访问文件夹时的名字
path = /samba/anonymous #这是共享文件夹的路径
browsable =yes
writable = yes
guest ok = yes
read only = no

4.编辑完后保存rest

5. 建立共享文件夹而且启用smb和nmb服务与启动它们code

mkdir -p /samba/anonymous
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service

6. centos7的防火墙可能会阻止外部访问server

firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload

7.这个时候能够在windows中经过 \\ip访问了。固然也可能会出现无读写权限,若是出现则继续下面步骤

#给文件夹设置权限
chmod -R 0755 anonymous/
chcon -t samba_share_t anonymous/

我到这个时候就已经能够了。


8.后面会继续配置samba的安全服务

请查看源网页:3. Secured samba server 这个部分

相关文章
相关标签/搜索