# Login fails from Windows on NTFS-3G Samba Share

I have a Raspberry Pi (though could be any Debian Linux box) connected to an external hard disk formatted as NTFS.

My disk mount in fstab is:

/dev/sda1 /media/disk  ntfs-3g  defaults,uid=1000,gid-1000,dmask=007,fmask=007  0  0


where user 1000 is the 'pi' user

/media/disk/shared is my Samba root folder. Must be accessible from Windows and Mac

Now, I can see the share in Windows, but I get permission denied. If I try mapping a drive to it, and attempt login using \machinename\pi the login fails.

Any ideas?

Edit-- smb.conf below. I've removed all comment lines (I assume lines beginning # or ; are comments)

[global]

workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
passdb backend = tdbsam
obey pam restrictions = yes
passwd program = /usr/bin/passwd %u
map to guest = bad user

usershare allow guests = yes

[shared]
comment = Ali and Greg Shared Folders
writeable = yes
public = yes
browseable = yes
path = /media/disk/shared
guest only = yes
guest ok = yes

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no

[print\$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
guest ok = no

[hdd]
comment = Samba server's HDD
locking = no
path = /media/disk/shared
guest ok = yes

-
 Did you add the users to the Samba password database using smbpasswd -a? Samba does not authenticate against /etc/shadow && /etc/passwd. See http://www.samba.org/samba/docs/man/manpages-3/smbpasswd.8.html. – Sean C. Oct 1 '12 at 19:12 More confused! I tried smbpasswd. Still couldn't connect. Created a new share. Still couldn't connect. Messed with various Windows (8) file sharing and network discovery settings. It starts working on the new share (but not the old one). I then one by one change all the Windows settings back to what they were, expecting the share to stop working... it still works. I will try to redo this server from scratch from my notes and figure this out. But not tonight! Thanks for the suggestion though. – Greg Woods Oct 1 '12 at 20:21 In smb.conf, the share that works is /media/disk, the share that doesn't is /media/disk/shared. Both have the same permissions. – Greg Woods Oct 1 '12 at 20:30 Attempting to connect from a second Windows 7 PC failed. I go back to the partially working Windows 8 PC, and now that fails to connect on both shares. I have changed nothing on the Debian box. This is too random. I am beyond help. Will start from scratch :( – Greg Woods Oct 2 '12 at 9:49 Could you please post the contents of your smb.conf file? – Sean C. Oct 2 '12 at 13:06

Here's my configuration and it works:

[public]
comment = Public Storage
path = /media/hddusb
guest ok = yes
browseable = yes

-
 This works for me, provided my fstab mount point is set up with no security at all (mask permissions of 000). I had to work that bit out for myself :) – Greg Woods Oct 3 '12 at 21:05 I commented on my own post below before I read this. I'm glad you got it worked out. – Sean C. Oct 4 '12 at 11:12

From 0 to Samba on RaspberryPi (Debian)!

root@raspberrypi:/var/log# uname -a
Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux
root@raspberrypi:/var/log# cat /etc/issue
Debian GNU/Linux wheezy/sid \n \l


This works for me on my Pi. The smb.conf is 8 lines (not counting the blank). I've connected with both Mac OSX and Windows 7 clients without issue using the username testme with password set to testme. You could literally paste this line for line other than setting the passwords.

##the REQUIRED smbpasswd is part of samba-common-bin -- YOU MUST EXPLICITY SELECT IT
aptitude install samba samba-common-bin
mkdir -p /data/share
chmod 1777 /data/share
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

cat > /etc/samba/smb.conf << "EOF"
workgroup = workgroup
netbios name = rpi

[share]
path = /data/share
browseable = yes
valid users = testme
EOF

useradd -s /bin/bash -d /home/testme -m testme

I would remove /etc/fstab from the equation, and even NTFS for the moment. Mount a local directory as a samba share. If that works, mount the NTFS share with a simple mount command which, devoid of fstab, accepts the default options. I plugged in a NTFS formatted disk, mounted it with mount -t ntfs /dev/sdb1 /mnt/ntfs and then shared it out with samba without issue. – Sean C. Oct 4 '12 at 11:09