实现这个功能 需要在树莓派上面安装samba服务,接下来的操作是在假设你已经用装载了Raspbian系统的SD卡启动了树莓派,并且进入了命令行模式的前提下进行的。
输入命令
sudo bash
apt-get samba
等待操作完成后树莓派会提示你 Do you want to continue 是否要继续(是/否)
输入Y 完成安装安装完毕后运行
nano /etc/samba/smb.conf
找到下面这一段
####### Authentication #######
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details. security = user 修改这一行
找到这一段
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user guest account = pi 添加这一行
到文件底部
添加下面几行
[Media]
comment = usb storage
path = /home/pi
browseable = Yes
read only = No
guest ok = Yes