Score:0

Files are not deleting through a samba share

us flag

I'm running Kubuntu 21.04. I have an external USB3 8TB drive formatted as ext4. It is being shared on the network as SAMBA share. The name of the drive is nest, and my smb.conf is configured as below:

[nest]
comment = nest
path = /media/JMS10/nest
read only = no
browsable = yes
guest ok = no
public = yes
force user = JMS10

I am connecting to the share from an Windows 10 laptop. When Windows asks for a username/password, I'm using JMS10 as the username, and I specify the password. I'm able to browse and view all of the contents. The problem is when I delete a file, it tells me it is deleted, but when I refresh the folder the files are still there. Also when I open the folder physically from my Kubuntu PC I can also see the files.

So I'm not sure why the files aren't getting deleted. It used to work fine before, and at some point it stopped working properly. I haven't changed the smb.conf in a long time.

jpbrain avatar
ca flag
hi JMS. if you do "ls -la on /media/JMS10/nest", what permissions are you seing?
jpbrain avatar
ca flag
try this... change force user to root and use explicit write list = {users} separated by space. Remember restarting you samba server.
us flag
The user and group is JMS10. And the permissions are `drwxrwxr-x` for directories, and `-rw-rw-r--` for files.
us flag
I tried `force user = root`, and `write list = JMS10` but it is still doing the same thing.
jpbrain avatar
ca flag
perms look ok. is it one file or every file?
us flag
It is every file. I also have another drive and it does the same thing. I rebooted the machine also.
jpbrain avatar
ca flag
still diging... :-) it is strange because you said that have not change anything. what's the output of groups command for JMS10 account?
us flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/128988/discussion-between-jms10-and-jpbrain).
Score:0
us flag

I was able to find the issue. There were a few things wrong with my setup. Also, it was not logging any error messages in the /var/log/samba folder. My guess is that since I was connecting from a Windows client, there is probably an edge case (bug) that I hit.

First, I removed the public and guest ok properties. I found out that they are synonymous, and if you look at my original config above, I was setting yes for one and no for the other.

Second I added my user to SAMBA by runnning smbpasswd -a JMS10, and added the valid users line below. After that it started working.

[nest]
path = /media/JMS10/nest
read only = no
browsable = yes
valid users = JMS10

So my setup was incorrect, and not sure why it was working before without any issues. My assumption was that SAMBA doesn't need a separate username, but that was incorrect. For any newbies out there, SAMBA doesn't integrate with your Linux account. So you have you create a new user for SAMBA, and the password is also different from your Linux account.

David avatar
cn flag
the password is also different from your Linux account. I do not think this is correct and in my case on 6 different machines it is not.
us flag
That's very odd. Maybe because I passed the `-a` parameter it sets a different password.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.