# How can I log into my Raspberry PI samba fileshare from Windows?

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 raspian 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
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]"
Server role: ROLE_STANDALONE
[global]
workgroup = WORKGROUP
server string = %h server
map to guest = Bad User
obey pam restrictions = Yes
passwd program = /usr/bin/passwd %u
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

[usb]
comment = USB Share
path = /media/Media
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?

Edit:
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.

[global]
security=user
[usb]
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.

Resolution

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 http://superuser.com/questions/57092/cant-change-permission-ownership-group-of-external-hard-drive-on-ubuntu
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 '12 at 6:35
@Mose The specified network password is not correct. –  Biff MaGriff Nov 7 '12 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 '12 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. –  Biff MaGriff Nov 7 '12 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 '12 at 19:27

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


[global]
workgroup = workgroup
server string = MY-SERVER
security = user
map to guest = Bad User
guest ok = yes

path = /home/tom
writeable = yes

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.

-
Thanks ppumkin I'll give it a shot. –  Biff MaGriff Nov 6 '12 at 16:00
I'm getting security=share is deprecated and I am still unable to access the share. –  Biff MaGriff Nov 7 '12 at 19:08
Things changed so I updated the answer- Not seen that before but it looks like thats how things are done now. –  ppumkin Nov 8 '12 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. –  Biff MaGriff Nov 12 '12 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!

-