1.安装Samba
sudo apt-get update sudo apt-get install samba samba-common-bin
2.配置账户
sudo useradd pishare #新建账户 sudo passwd pishare #设置密码 sudo smbpasswd -a pishare #添加 Samba 用户 sudo smbpasswd -e pishare #激活用户
3.配置Samba
sudo vi /etc/samba/smb.conf
添加以下内容
[public] comment = Public Storage path = /home/pi/share read only = no create mask = 0777 directory mask = 0777 guest ok = yes browseable = yes
smbd restart #重启服务
4.挂载移动硬盘
sudo apt-get install exfat-fuse #支持exfat sudo fdisk -l #列出所有硬盘 mkdir share #/home/pi下新建share目录用于挂载 sudo mount /dev/sda1 ~/share
Leave a Reply