Centos
#关闭防火墙:stop暂时关闭,disable永久关闭
setenforce 0 sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config systemctl stop firewalld systemctl disable firewalld systemctl stop smb pdbedit -x -u y00 pdbedit -a -u y00 chown -Rf y00:y00 /home/y00 systemctl start smb systemctl enable smb systemctl status smb
#开启防火墙samba无法映射?
systemctl start firewalld
systemctl enable firewalld
systemctl status firewalld
Ubuntu
apt-get install samba samba-common sudo smbpasswd -a yoyu cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vim /etc/samba/smb.conf
[home] #共享名,该共享标签,可随意取,该名字为在其他电脑上看到的共享名 comment = home directories #该共享描述 path = /home/ #共享路径 public = yes #指定该共享是否允许guest账户访问 writable = yes #writable用来指定该共享路径是否可写 workgroup = DAWN #设定 Samba Server 所要加入的工作组或者域
重启samba
service smbd restart
windows访问,本地文件路径访问
\172.23.56.8home