树莓派使用Samba共享文件夹
转载自:http://raspberrypihq.com/how-to-share-a-folder-with-a-windows-computer-from-a-raspberry-pi/
Sharing files over the network is often very useful. Whether you need to transfer media files to the Raspberry Pi or you want to use the raspberry as a simple Network-Attached Storage (NAS) device, this guide will show you how to enable file sharing of a folder on the Raspberry Pi running the Raspbian OS.
Prerequisites & Equipment
You are going to need the following:
- A Raspberry Pi (Buy here)
- A SD Card flashed with the Raspbian OS (Here is a guide if you need)
- Access to the Raspberry either via keyboard and a monitor or remotely
- A home network
- A Windows computer (for this guide we will be running Windows 7)
Install and configure required software
To share network folders to a Windows computer we need to install some special software on the Raspberry Pi. The software providing the secret sauce this time is called Samba. The Samba software package implements the SMB protocol and provides support for the Windows naming service (WINS) and for joining a Windows Workgroup.
Installing the software is easy – login to your Raspberry Pi and run:
sudo apt-get install samba samba-common-bin
After installation configure the software by opening the file /etc/samba/smb.conf using the command:
sudo nano /etc/samba/smb.conf
Read through the file and make sure you have the following parameters set:
workgroup = WORKGROUP
wins support = yes
You can use anything as your workgroup name as long as it is alphanumerical and matches the workgroup you would like to join. The default workgroup in Windows 7 is WORKGROUP.
Setup folder to share
Next step is to create the folder you would like to share. To create a folder called “share” in your home directory do the following:
mkdir ~/share
With the folder created we can now tell the Samba software to share it on the network. Open the file /etc/samba/smb.conf using the command:
sudo nano /etc/samba/smb.conf
Scroll to the bottom and add the following:
[PiShare]
comment=Raspberry Pi Share
path=/home/pi/share
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=no
Notice how we tell Samba that public access is not allowed via “public=no” – this means that anyone wanting to access the shared folder must login with a valid user.
In this case the valid user is the user called “pi”. To let Samba know that “pi” is a network user run the command:
sudo smbpasswd -a pi
And enter pi’s password twice (default: raspberry).
At this point we can now login to the share from our Windows computer – use Domain: raspberrypi, User: pi and Password: raspberry (unless you changed the password) as you can see below:

If you do not want to deal with logging in you can always make the share publicly available by changing the config file to say:
public=yes
However please note that this is extremely dangerous since anyone will be able to access, modify and delete your files.
树莓派使用Samba共享文件夹的更多相关文章
- 常见企业IT支撑【2、samba共享文件夹】
samba共享文件夹,较Window自带的比较:开源,安全 建议安装samba4,兼容性好 1.安装samba #yum -y install samba4 samba4-client 2.备份sam ...
- 使用samba共享文件夹,提供给window访问
1. 下载yumdownloader yum install -y yum-utils 2. 下载samba mkdir samba cd samba yumdownloader --resolve ...
- samba共享文件夹设置
sudo apt-get install samba(4) mkdir /home/用户名/share (新建share文件夹) sudo cp /etc/samba/smb.conf /etc/sa ...
- ubuntu 安装samba共享文件夹
安装samba sudo apt-get install samba smbclient 配置samba sudo cp /etc/samba/smb.conf /etc/samba/smb.conf ...
- cetos6 安装samba共享文件夹
yum方式安装 yum install samba 修改配置文件 vim /etc/samba/smb.conf [global] comment = global workgroup = QFpay ...
- Linux使用mount挂载samba共享文件夹
挂载smb的目录,使用读写644权限 mount -t cifs -o "rw,dir_mode=0644,file_mode=0644,username=username,password ...
- Ubuntu 配置、使用samba共享文件夹
安装库 sudo apt install smbclient samba samba-common 启动samba sudo /etc/init.d/samba start 备份配置文件 sudo c ...
- debian 11 开启 samba 共享文件夹
安装 apt-get install samba 安装时,提示搜索不到 此包时 解决办法1:apt-get update 更新源 解决办法2:更改镜像源,可以采用阿里云,网易云等镜像站里提供的镜 ...
- [Z] 将samba共享文件夹映射到linux的目录下
Linux系统下访问远程共享资源 使用mount加载共享目录: -把WinXP机器192.168.16.249上的共享目录test001映射到本地目录/wdl/下. -把Linux机器192.168. ...
随机推荐
- 树和二叉树 -数据结构(C语言实现)
读数据结构与算法分析 树的概念 一棵树是一些节点的集合,可以为空 由称做根(root)的节点以及0个或多个非空子树组成,子树都被一条来自根的有向边相连 树的实现 思路 孩子兄弟表示法:树中的每个节点中 ...
- (原) MaterialEditor部- UmateriaEditor中 Node编译过程和使用(2)
@白袍小道 转载说明原处 插件同步在GITHUB: DaoZhang_XDZ 需求: 1.梳理FexpressionInput和Output的编译和链接(套路和逻辑目的) 2.如何做到节点编译 ...
- Python中如何Getting Help
在Python中Gettting Help有如下两种方法: 1 使用dir函数,dir的参数可以是一个真正的对象实例,也可以是一个数据类型,无论哪种情形,dir函数都返回与这个对象或者数据类型相关联的 ...
- Thunder团队第五周 - Scrum会议5
Scrum会议5 小组名称:Thunder 项目名称:i阅app Scrum Master:翟宇豪 工作照片: 杨梓瑞同学在拍照,所以不在照片内. 参会成员: 王航:http://www.cnblog ...
- [zt]手把手教你写对拍程序(PASCAL)
谁适合看这篇文章? ACMERS,OIERS或其它参加算法竞赛或需要算法的人 对操作系统并不太熟悉的人 不会写对拍的人 在网上找不到一个特别详细的对拍样例的人 不嫌弃我写的太低幼的人 前言 在NOIP ...
- vim map nmap(转)
转自:http://blog.csdn.net/taoshengyang/article/details/6319106 有五种映射存在 - 用于普通模式: 输入命令时. - 用于可视模式: 可视 ...
- phpcms 模型
- FastReport.net 常用方法
一.页面设置 情景:FastReport设计器页面默认设置为A4纸,但如果需要显示的字段过多,这时就出现了页面的大小无法满足完整显示所需内容的问题. 解决:出现这个问题后,我们可以在来到"文 ...
- 解决编写 xml 没有代码提示
有时候在编写 struts.xml 会没有代码提示,一般是因为没有联网导致的,或者之前配置过 dtd 文件 url,但是文件路径之后被修改了. 解决方案有: 让电脑联网 修改 dtd 的本地路径以及 ...
- [剑指Offer] 44.翻转单词顺序列
题目描述 牛客最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上.同事Cat对Fish写的内容颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意思.例如,“student ...