[Samba] Can write/delete files but can't overwrite
by littlebigman from LinuxQuestions.org on (#5545K)
Hello,
Using the following settings, I can successfully copy/delete files from a Windows 7 host with no local account (Unix, Samba), but can't overwrite a file: I must first delete the file before copying a new version.
Can you spot what's wrong?
Thank you.
Code:me@host:~# ll /mnt/sdcard/
total 36996
drwxrwxrwx 2 root root 8192 Jun 28 12:21 ./
drwxr-xr-x 3 root root 4096 Jul 11 2018 ../
-rw------- 1 root root 27273474 Jun 28 12:15 Backup.zipCode:me@host:~# cat /etc/fstab
UUID=2ef427a6-37b0-494a-9eda-5f627e2d633f / ext4 errors=remount-ro 0 1
UUID=d71106d8-83af-47ab-bd56-bdfd2d4711f3 /boot ext2 defaults 0 2
UUID=7d3971ad-2dca-4ae6-b67a-27b2190df289 none swap sw 0 0
#SD card
UUID=BF90-FE5B /mnt/sdcard vfat dmask=000,fmask=0177,user 0 0Code:me@host:~# cat /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
netbios name = MYHOST
security = user
map to guest = Bad User
;www-data used by Nginx
guest account = www-data
hosts allow = 127.0.0.1 192.168.0.0/24
hosts deny = 0.0.0.0/0
bind interfaces only = yes
interfaces = 192.168.0.15/255.255.255.0 127.0.0.1/255.255.255.255
log level = 2
wins support = yes
local master = yes
preferred master = yes
domain master = yes
os level = 255
;this avoids needless errors in the logs if you have no printer
printcap name = /dev/null
load printers = no
printing = bsd
[sdcard]
path = /mnt/sdcard
;comment = No need for Unix/Samba passwords
guest ok = yes
writeable=yes
;valid users=www-data
browseable=yes
force create mode = 0644
create mask = 0664
;Unknown parameter encountered: "security mask"
;security mask = 0664
;Unknown parameter encountered: "force security mode"
;force security mode = 0664


Using the following settings, I can successfully copy/delete files from a Windows 7 host with no local account (Unix, Samba), but can't overwrite a file: I must first delete the file before copying a new version.
Can you spot what's wrong?
Thank you.
Code:me@host:~# ll /mnt/sdcard/
total 36996
drwxrwxrwx 2 root root 8192 Jun 28 12:21 ./
drwxr-xr-x 3 root root 4096 Jul 11 2018 ../
-rw------- 1 root root 27273474 Jun 28 12:15 Backup.zipCode:me@host:~# cat /etc/fstab
UUID=2ef427a6-37b0-494a-9eda-5f627e2d633f / ext4 errors=remount-ro 0 1
UUID=d71106d8-83af-47ab-bd56-bdfd2d4711f3 /boot ext2 defaults 0 2
UUID=7d3971ad-2dca-4ae6-b67a-27b2190df289 none swap sw 0 0
#SD card
UUID=BF90-FE5B /mnt/sdcard vfat dmask=000,fmask=0177,user 0 0Code:me@host:~# cat /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
netbios name = MYHOST
security = user
map to guest = Bad User
;www-data used by Nginx
guest account = www-data
hosts allow = 127.0.0.1 192.168.0.0/24
hosts deny = 0.0.0.0/0
bind interfaces only = yes
interfaces = 192.168.0.15/255.255.255.0 127.0.0.1/255.255.255.255
log level = 2
wins support = yes
local master = yes
preferred master = yes
domain master = yes
os level = 255
;this avoids needless errors in the logs if you have no printer
printcap name = /dev/null
load printers = no
printing = bsd
[sdcard]
path = /mnt/sdcard
;comment = No need for Unix/Samba passwords
guest ok = yes
writeable=yes
;valid users=www-data
browseable=yes
force create mode = 0644
create mask = 0664
;Unknown parameter encountered: "security mask"
;security mask = 0664
;Unknown parameter encountered: "force security mode"
;force security mode = 0664