Skip to content
ArtMG edited this page Sep 19, 2018 · 7 revisions

Samba

To share files so that Windows and Linux clients can access them easily across the network, use Samba.

If you want sharing JUST for Linux clients then NFS is simpler

  • see [https://github.com/artmg/lubuild/blob/master/help/configure/Networked-Services.md]

Also, if you can connect with SSH (Secure SHell), then it's simple to access files using SFTP (SSH File Transfer Protocol). This usually works out of the box, and is supported by many file browsers - just look for the "Connect to Server" option, and also works with most FTP clients. For more details see Sharing Folders / Across LAN / SFTP in [https://github.com/artmg/lubuild/blob/master/help/configure/Networked-Services.md].

Explanation

Samba is a Server Message Blocks (SMB) server, to share files and printers across a network, in a way that Windows PCs can access easily.

Because SMB is the default way for Windows to share files, it is commonly used as a cross-platform solution from Linux servers (rather than just using the NFS Network File System that only Unix understands). Samba runs a daemon listening at port 445 that uses SMB. An early version of was known as CIFS, the Common Internet File System, but Microsoft replaced this with newer improved versions of SMB 2 or 3. See more info at [https://en.wikipedia.org/wiki/Server_Message_Block]

The Samba config file may also turn on WINS, the Windows Internet Naming Service, so that computer names are broadcast and can be used instead of IP addresses.

For more advanced configurations, please see [https://github.com/artmg/lubuild/blob/master/help/configure/network-shares-with-Samba.md]

Install

sudo apt-get install -y samba samba-common-bin

Configure

Use leafpad from the GUI or nano from the terminal to set the following config

sudo nano /etc/samba/smb.conf

# credit - http://raspberrywebserver.com/serveradmin/share-your-raspberry-pis-files-and-folders-across-a-network.html
# you will find lines already in the file for this first section.
# remove the # comment from the start of the line if required
# and set the following values after the =
[global]
workgroup = WORKGROUP
wins support = yes

# now add this as a new section at the end of the file
[pihome]
   comment= Pi Home
   path=/home/pi
   browseable=Yes
   writeable=Yes
   only guest=no
   create mask=0777
   directory mask=0777
   public=no
Clone this wiki locally