I'm trying to set up an SMB share on my network using Samba.

I followed the directions here as well as I could as I have Raspbian installed on my Pi. When I plugged in my USB drive it automounted to /media/Media/ so I skipped the first part.

What I did was the following:

  1. sudo -i
  2. apt-get update
  3. apt-get upgrade
  4. apt-get install samba
  5. apt-get install samba-common-bin
  6. Edited samba config

    Load smb config files from /etc/samba/smb.conf  
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)  
    Processing section "[usb]"  
    Loaded services file OK.  
    Server role: ROLE_STANDALONE  
        workgroup = WORKGROUP  
        server string = %h server  
        map to guest = Bad User  
        obey pam restrictions = Yes  
        pam password change = Yes  
        passwd program = /usr/bin/passwd %u  
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .  
        unix password sync = Yes  
        syslog = 0  
        log file = /var/log/samba/log.%m  
        max log size = 1000  
        dns proxy = No  
        usershare allow guests = Yes  
        panic action = /usr/share/samba/panic-action %d  
        idmap config * : backend = tdb  
        valid users = %S  
        create mask = 0700  
        directory mask = 0700  
        comment = USB Share  
        path = /media/Media  
        read only = No  
        create mask = 0777  
        directory mask = 0777  
        guest only = Yes  
        guest ok = Yes

So the setup appears OK, I can see the files in /media/Media on the Pi, I can see RASPBERRYPI in my workgroup from my Windows7 box. But when I try to access it I get a logon failure. I also have a 2nd pi with RaspBMC installed and I also cannot access the SMB share from there either.

Is there something else I need to do in Samba to get this working?

I did some more work on this last night. I added a new user to the Raspberry, set a password, added a new user to Samba, set the password and added the following lines.

allow users biff

(or something similar I forget the exact syntax)

And now I've managed to get an error like... "You do not have authorization to access this share". I'm thinking perhaps I'll work on my Pi directly tonight instead of using putty and perhaps there is something I'll be able to see when using a text editor instead of vi.


Ok I finally resolved this. The problem was that I could not use the pi login to access the pie using smb and also that I could not change the permissions of the automounted /media/Media drive.
I found my solution here https://superuser.com/questions/57092/cant-change-permission-ownership-group-of-external-hard-drive-on-ubuntu
I had to install ntfs
sudo apt-get install ntfs-config
and then I ran the ntfs configuration tool which just gives anyone read/write access.

Not the best solution but it is sufficient in my case for sharing files on the network.

  • what is the exact error you get on your windows box?
    – Mose
    Nov 6, 2012 at 6:35
  • @Mose The specified network password is not correct. Nov 7, 2012 at 4:49
  • Not related to what you have asked, but you can also mount your Pi on Windows over SSH - dokan-dev.net/en/download/#sshfs
    – Lord Loh.
    Nov 7, 2012 at 18:51
  • @LordLoh. Thanks Loh, my ultimate goal here is to have an always on network share that my Raspbmc, Wii and Windows machines can access so I don't have to have my main computer on all the time. Nov 7, 2012 at 19:18
  • Can you try this? Give the Username as RASPBERRYPI\pi(where pi is a user in raspberry pi) and password as the password of the user.PRobably you have already tried this but just in case :)
    – SteveIrwin
    Nov 7, 2012 at 19:27

3 Answers 3


You have to setup samba to allow anonymous/everyone/guest to be able to connect. This takes away the error message you.

This is deprecated ...

security = share
guest account = nobody

Use this instead

    workgroup = workgroup
    server string = MY-SERVER
    security = user
    map to guest = Bad User
    username map = /etc/samba/smbusers
    guest ok = yes

    path = /home/tom
    writeable = yes
    valid users = username1

    path = /home/nobody
    writeable = yes

Possibly some other settings in the config need relaxing.. Samba in Linux is more secure than in Windows. The irony ... :-]

I hope that helps you.

  • I'm getting security=share is deprecated and I am still unable to access the share. Nov 7, 2012 at 19:08
  • Things changed so I updated the answer- Not seen that before but it looks like thats how things are done now.
    – Piotr Kula
    Nov 8, 2012 at 10:39

I would suggest reconfiguring RPi and Samba using the setup shown here - http://www.megaleecher.net/Adding_External_USB_Disk_Drive_Storage_On_RasPi, this worked for me without any issues.

  • This was helpful, got me on the right path. Nov 12, 2012 at 0:52

I was having this same problem, and was able to find a solution different from those posted above. I hope this is helpful to somebody else in a similar predicament

You mentioned that you were unable to change the permissions of the automounted folder - this is where the problem lies.

To fix, simply unmount the automounted drives by clicking the eject logo in the file explorer, or through the command line.

Then create a new folder in the media directory, I made mine "USBHDD1"

sudo mkdir /media/USBHDD1

Then mount the currently unmounted drive to this folder using

sudo mount -t auto /dev/sda1 /media/USBHDD1

Then you should be able to access the folder!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.