DigitalEssence
Posts: 17
Joined: Mon Aug 18, 2014 7:07 pm

Problems authenticating with samba share

Wed Aug 20, 2014 10:47 am

Hi,

I'm trying to set up Samba on my Pi and access it from my Windows machines.

I've plugged a usb drive in and mounted /dev/sda1 to /media/usbdrive (I think)

I can see the share in Explorer but not login in to it and no matter how much searching I do I can't find the answer and am at the stage where I think I am doing more damage than good so want to ask some grownups for help please.

I have a usb drive plugged in and mounted under /media.

Output of mount

Code: Select all

/dev/sda1 on /media/usbdrive type vfat (rw,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro)
Output of ls -la /media/

Code: Select all

drwxr-xr-x  4 root root  4096 Aug 19 16:10 .
drwxr-xr-x 24 root root  4096 Aug 19 11:16 ..
drwxr-xr-x  4 root root  1024 Jan  1  1970 SETTINGS
drwx------ 14 pi   pi   32768 Jan  1  1970 usbdrive
Output of smb.conf

Code: Select all

#======================= Global Settings =======================

[global]
        log file = /var/log/samba/log.%m
#      guest account = guest (If this was left in then smbd failed to start)
        obey pam restrictions = yes
        encrypt passwords = yes
        public = yes
        passdb backend = tdbsam
        dns proxy = no
        netbios name = Pi NAS
        writeable = yes
        server string = %h NAS Server
        invalid users = root
        workgroup = WOODLANDS
        os level = 20
        syslog = 0
        security = share
        panic action = /usr/share/samba/panic-action %d
        max log size = 1000

[USBDRIVE]
        path = /media/usbdrive
        force group = users
        create mask = 0660
        comment = Media Drive on Pi
        directory mask = 0771
        valid users = @users

I've then added the user hedley to samba

Code: Select all

smbpasswd –a hedley
Restarted samba and see both

root@raspberrypi:/home/pi# service samba restart
[ ok ] Stopping Samba daemons: nmbd smbd.
[ ok ] Starting Samba daemons: nmbd smbd.

But when I try to login to the share from windows explorer \\192.168.19.90\usbdrive with the user details:

raspberrypi\hedley
password (as set in smbpasswd)

or any combination of just username, workgroup\user etc it doesn't log me in. (I checked that raspberrypi is the correct hostname)

I'm a bit lost now. I've read a stack of articles but don't seem to be getting anywhere. Although a few posts ask for the contents of fstab which oddly on mine doesn't mention /dev/sda1

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p5  /boot           vfat    defaults          0       2
/dev/mmcblk0p6  /               ext4    defaults,noatime  0       1
I hope I've provided the right information here. If you need more please do say. I'm new to all this so still finding my feet.

Thanks for your help, it is very much appreciated.


Heds

User avatar
hansotten
Posts: 341
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Problems authenticating with samba share

Wed Aug 20, 2014 11:18 am

I would prefer network names like the netbios name without a space (pi NAS) , that is what gets advertized over the network.
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

DigitalEssence
Posts: 17
Joined: Mon Aug 18, 2014 7:07 pm

Re: Problems authenticating with samba share

Wed Aug 20, 2014 11:32 am

hansotten wrote:I would prefer network names like the netbios name without a space (pi NAS) , that is what gets advertized over the network.
Thanks for the advice, I've just given this a go. Edited smb.conf so that:

netbios name = PiNAS

restarted Samba and I see the new name in explorer but still have the same issues with logging in.

DigitalEssence
Posts: 17
Joined: Mon Aug 18, 2014 7:07 pm

Re: Problems authenticating with samba share

Wed Aug 20, 2014 12:57 pm

Hi,

I scrapped everything and went back to basics using the original smb.conf and removed the mounted drive. Set it all up again from scratch and it now works and I can get access to my share.

No idea why it didn't work but yet again, making a backup saved the day ;-)

Thanks for your help.


Heds

Return to “Troubleshooting”