Raspberry-Pi : Samba (Network Attatched Server)

 

Instructions for setting up you Raspberry Pi as a Network Attached File Server

 

List plugged in media to verify what they are called

$ ls /mnt

mydrive                 (write your drive name down, you will need this later)

 

 

Install Samba

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

 

$ cd /etc/samba

/etc/samba $ ls

gdbcommands smb.conf                            (make sure you see these files)

 

create a copy of smb.conf to smb.conf.master (keeping an original)

/etc/samba $ sudo cp smb.conf smb.conf.master

 

$ sudo nano smb.conf     (edit config file)

                                                  (only the lines need to be changed will be shown)

 

Modify the [global] section

 

[global]

workgroup = (from the network that will be accessing the Samba Server)

 

Modify the [homes] section    (search for 'homes')

Instructions are included within smb.conf for your convenience.

 

[homes]

   read only = No

   create mask = 0775

   directory mask = 0775

 

NOTE: this will give full access to your USER's folder ONLY

located at     /home/(userID)  on the "System" partition !

 

go to the bottom of smb.conf and add the following lines

 

-------------------------------do not include this line

 

[usb]                               #  (name of share)

   comment = USB Share

   path = /mnt/MyDrive    # (from ls /media command that I told you to write down)

   valid users = pi       # NOTE: Here... path is /mnt NOT /media

   read only = No         # We want the 'logical' location  we created

   create mask = 0777           

   directory mask = 0777

   guest ok = Yes 

 

-------------------------------do not include this line

 

ctrl-o <Enter> ctrl-x

(write file) (yes to confirm) (exit nano)

 

look for errors (typos & spelling), scroll up if nessecary

$ sudo testparm

 

Add the pi user to samba user database

$ sudo smbpasswd -a pi      (enter your current pi password when asked)

 

Restart Samba

$ sudo service samba restart   (old method)

$ sudo service smbd restart    (new method)

 

Now try connecting to your new PI server

From another computer browse the network to your PI

$ uname -n                            (The name of your Pi )

 

type this into the address bar of your windows file explorer (not internet explorer)

\\(pi server name)[\(name of share from above)]

 

Now click on the [Connect using a different user name] link

and enter your Raspberry Pi  user name and password

 

 

Problems?

Refuses to connect?

try \\(Raspberry Pi's IP address)[\sharename]     #Temporary fix

Enter your local router settings and enable NetBios, then reboot all affected devices

 

View the samba logs which are in /var/log/samba