树莓派使用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.

时间: 2024-10-29 22:27:46

树莓派使用Samba共享文件夹的相关文章

树莓派安装samba共享文件

安装samba: sudo apt-get install samba 修改samba配置: sudo nano /etc/samba/smb.conf 修改内容如下 去掉 security = user 前# 在 map to guest = bad user 行下添加  guest account = pi 共享目录方法(匿名访问读写) [Code]comment = Codepath = /home/pi/codebrowseable = Yesread only = Noguest ok

常见企业IT支撑技能【2、samba共享文件夹】

samba共享文件夹,较Window自带的比较:开源,安全 建议安装samba4,兼容性好 1.安装samba #yum -y install samba4 samba4-client 2.备份samba配置文件 #cp /etc/samba/smb.conf /etc/samba/smb.conf.bak 3.添加共享目录 把security = user 改为security = share 在最底部添加 [public] comment=public path=/samba public=

Vagrant 使用 samba 共享文件夹

在windows下使用Vagrant时可以使用samba方式共享文件夹. 配置如下: config.vm.synced_folder "./", "/path/to/web/root", type: "smb", smb_username: "user", smb_password: "pass", owner: "www", group: "www", mount_

使用samba共享文件夹,提供给window访问

1. 下载yumdownloader yum install -y yum-utils 2. 下载samba mkdir samba cd samba yumdownloader --resolve avahi-autoipd samba samba-client 3. 安装samba yum localinstall avahi-autoipd-0.6.31-17.el7.x86_64.rpm avahi-libs-0.6.31-17.el7.x86_64.rpm cups-libs-1.6.

Ubuntu 配置、使用samba共享文件夹

安装库 sudo apt install smbclient samba samba-common 启动samba sudo /etc/init.d/samba start 备份配置文件 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup 编辑配置文件 sudo gedit /etc/samba/smb.conf 后面添加如下内容 [Share] path = /home/username/Share available = yes br

Linux使用mount挂载samba共享文件夹

挂载smb的目录,使用读写644权限 mount -t cifs -o "rw,dir_mode=0644,file_mode=0644,username=username,password=yourpassword" //192.168.1.100/yourshare_folder_name /usr/local/your_server_folder 原文地址:https://www.cnblogs.com/faberbeta/p/samba003.html

samba 挂载windows共享文件夹

先转载一片文章     centOS下yum安装配置samba 地址 http://blog.csdn.net/linglongwunv/article/details/5212875 遇到问题1 # smbpasswd -a username 创建用户不成功 Failed to add entry for user usernamessss.     解决  创建系统管理员,就是登录服务器时候的那个. 有了系统管理员aaa  才能创建samba管理员aaa 从Windows 客户端连接到Sam

centos 配置 samba 与windows共享文件夹

yum install samba/etc/samba/smb.confdirectory mask = 0777 ← 指定新建目录的属性(以下4行) force directory mode = 0777 directory security mask = 0777 force directory security mode = 0777 create mask = 0777 ← 指定新建文件的属性(以下4行) force create mode = 0777 security mask =

利用Samba服务器在Ubuntu系统和Win7系统间共享文件夹

1 介绍 现在是网络化的时代,我们每个人要更好的发展,离不开网络化.信息化的支持.利用网络的支持,在不同的操作系统间共享文件等信息,是计算机专业学生必备的一项技能.本文所讲的就是如何建立.设置.链接Samba服务器,使得处在网络中的两台电脑,一台装的是Ubuntu操作系统,一台装的是Win7,通过共享文件夹的形式来共享信息.这两台电脑在网络上处的位置和网络架构为图1所示. 在图1的两台电脑实际上它们的物理位置都在我旁边,只是由于物理RJ47端口太少,就只有让台式机连接到Rj47端口上,而我的笔记