### yum install -y samba samba-client samba-common### 备份cp /etc/samba/smb.conf /etc/samba/smb.conf_bak### 配置vi /etc/samba/smb.conf [global]workgroup = WORKGROUPserver string = Samba Server %vnetbios name = centossecurity = usermap to guest = bad userdns proxy = no#============================ Share Definitions ============================== [Anonymous]path = /samba/anonymousbrowsable =yeswritable = yesguest ok = yesread only = no :wq#保存并退出### 设置开机启动 并 启动mkdir -p /samba/anonymoussystemctl enable smb.servicesystemctl enable nmb.servicesystemctl restart smb.servicesystemctl restart nmb.service### 添加防火墙 -A INPUT -p udp -m tcp --dport 137 -j ACCEPT -A INPUT -p udp -m tcp --dport 138 -j ACCEPT -A INPUT -p tcp -m tcp --dport 139 -j ACCEPT -A INPUT -p tcp -m tcp --dport 445 -j ACCEPT ### 或者firewall-cmd --permanent --zone=public --add-service=samba