sudo apt-get install samba samba-common
sudo chmod -R 777 /home/
sudo smbpasswd -a root
注:添加samba用户,用于其他人或设备认证,这里添加的用户需要在系统账号中存在,否则添加失败
先备份sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak,以防改错,sudo vim /etc/samba/smb.conf 修改配置,添加共享,可直接加到文件尾
[home] comment = home directories path = /hdd-work/samba/ public = yes writeable = yes
sudo ufw allow 137 sudo ufw allow 138 sudo ufw allow 139 sudo ufw allow 445