原创教程 转载请注明作者出处连接

Linux系统可以通过samba服务实现与windows网络共享兼容的网络共享服务,嫌开着电脑共享文件太费资源的话,不妨让树莓派来实现这个网络文件共享的功能

实现这个功能 需要在树莓派上面安装samba服务,接下来的操作是在假设你已经用装载了Raspbian系统的SD卡启动了树莓派,并且进入了命令行模式的前提下进行的。
输入命令
sudo bash
apt-get samba
等待操作完成后树莓派会提示你 Do you want to continue 是否要继续(是/否)
输入Y 完成安装
samba1-1.jpg

 
安装完毕后运行
nano /etc/samba/smb.conf
samba1-2.jpg
找到下面这一段
####### 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   



samba1-3.jpg
Ctrl+O保存  Ctrl+W退出
运行命令
service samba restart



至此配置完成  
可以把树莓派/home/pi目录下的东西共享到网路上
并且 匿名用户可以读写目录里面的文件