安装 sudo apt install
运行后samba会监听两个端口,445和139,可通过端口查看命令查看 netstat -antp|grep smbd
切换到samba的配置目录下,修改配置 cd /etc/samba/
sudo gedit smb.conf
参考配置如下
[global]
workgoup = MYGROUP
server string = Samba Server Version %v
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
[code]
path = /home/carl/hellocpp
public = yes
writable = yes
printable = no
create mask = 0777
sync always = ye
创建共享文件夹/home/carl/hellocpp
mkdir -p /home/carl/hellocpp
sudo chmod -R 777 /home/carl
配置完成后重启samba sudo /etc/init.d/smbd restart
可通过