Home > How To, Raspberry pi, Technology > Setting up your Raspberry pi as a Samba NAS server

Setting up your Raspberry pi as a Samba NAS server

November 18, 2012 Leave a comment Go to comments

This will show you how to change your Raspberry pi in to a simple NAS server with USB storage

1) Establish a remote connection to your Raspberry pi

Raspberry pi – Access the CLI on pi remotely with putty

2) Mount your USB Drive to Raspberry pi using the following guide

How to mount a USB drive to your Raspberry Pi

3) Create a new user account call nobody

smbpasswd -an nobody

4) Modify the Mount location owner permissions  with the following command

sudo chown nobody (Mounted file i.e /srv/media)

sudo chmod 755 (Mounted file i.e /srv/media)

3) Install the Samba software on the Raspberry pi

sudo apt-get install samba

sudo apt-get install samba-common-bin

4) Now we need to edit the configuration file used by the Samba software by running the following command

sudo nano /etc/samba/smb.conf

Add the following to the smb.conf file



Guest account = nobody

map to guest = bad user

[Share Definitions]


comment = Public Shares
browsable = yes
path = /srv/media
public = yes
writable = yes
guest ok = yes”


5) Restart the Samba software which will load the new modified configuration file

sudo service samba restart

6) Test to see if you can access samba share from your another device such as windows XP

7) Now we need to set up the program which will auto-load the USB drive when we reboot the raspberry pi

sudo apt-get install autofs

8) Once installed you will to edit the autofs configuration file by running the following command

sudo nano /etc/auto.master

At the end of the file is the following


You need to add the following below the +auto.master entry

/media/ /etc/auto.ext-usb –timeout=10,defaults,user,exec,uid=1000

You have now setup a simple NAS server on your Raspberry pi with a USB drive storage

  1. December 31, 2012 at 11:43 am

    Reblogged this on projectz.

  2. Note Order
    March 8, 2013 at 1:08 am

    sudo apt-get install samba-common-bin

    this must be done before using smbpasswd

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


The University of Glasgow's Raspberry Pi Project


Your all round solution for tech problems (and some others things...like spelling errors)

Raspberry Pi Kid

Adventures with Raspberry Pi

Naked Security

Computer Security News, Advice and Research

Dustin Software

Because programming is fun!

Pinoy Tekkie



Fun stuff for technics enthusiasts


Tech, Gadgets, Photography, Social Media and Poor Spelling

Programming My Rasberry Pi

A brave fool's adventures into the unknown!

Chris Ainger's Blog

Where Fishing Meets Computing


Information wants to be free

ITtechExec: Protecting Tech Careers Since 2001

Technical Career Advancement: Transformed. Guaranteed.


An Exclusive Web 2.0 Startups Review Blog

The Life of Me

Just another IT blog

%d bloggers like this: