树莓派使用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. ...
随机推荐
- Java and SDK 环境变量设置
File comes from http://www.cnblogs.com/shinge/p/5500002.html JAVA环境变量配置详解 JAVA环境变量JAVA_HOME.CLASSPAT ...
- lintcode671 循环单词
循环单词 The words are same rotate words if rotate the word to the right by loop, and get another. Cou ...
- CSP201709-1:打酱油
引言:CSP(http://www.cspro.org/lead/application/ccf/login.jsp)是由中国计算机学会(CCF)发起的"计算机职业资格认证"考试, ...
- 78[LeetCode] Subsets
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solut ...
- ACM入门步骤(一)
一般的入门顺序: 0. C语言的基本语法(或者直接开C++也行,当一个java选手可能会更受欢迎,并且以后工作好找,但是难度有点大),[参考书籍:刘汝佳的<算法竞赛入门经典>,C++入门可 ...
- POJ 2229 计数DP
dp[i]代表是数字i的最多组合数如果i是一个奇数,i的任意一个组合都包含1,所以dp[i] = dp[i-1] 如果i是一个偶数,分两种情况讨论,一种是序列中包含1,因此dp[i]=dp[i-1]一 ...
- 算法与数据结构实验题 4.2 小 F 打怪
★实验任务 小 F 很爱打怪,今天因为系统 bug,他提前得知了 n 只怪的出现顺序以及击 倒每只怪得到的成就值 ai.设第一只怪出现的时间为第 1 秒,这个游戏每过 1 秒 钟出现一只新怪且没被击倒 ...
- ACM 第四天
A - 最短路 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt.但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的 ...
- iOS- Apple零配置网络协议Bonjour的使用?
1.前言 这段时间为了解决公司App的网络离线需求,做了个Apple推出的零配置网络协议Bonjour的Test,主要是为了解决iOS设备的IP获取,之前是可以使用socket的广播来实现,但是使用A ...
- TCP系列31—窗口管理&流控—5、TCP流控与滑窗
一.TCP流控 之前我们介绍过TCP是基于窗口的流量控制,在TCP的发送端会维持一个发送窗口,我们假设发送窗口的大小为N比特,网络环回时延为RTT,那么在网络状况良好没有发生拥塞的情况下,发送端每个R ...