0

so my samba share requires permissions from Unix User\root to move or delete files. I don't understand why. You don't need to login to access the samba share. Just need to be on the network. The share is mounted at /media/Network on the server computer.

Here's the error I get when I try deleting/moving a file: error 1

smb.conf:

[Network]
    path = /media/Network
    writeable = yes
;   browseable = yes
    force user = cody
    guest ok = yes

Permissions: (ls -la /media/Network) (The red covered things are user folders I created) permissions

  • What are the permissions, at Linux level of your share (ls -la /media/Netwok) ? Is the Linux user cody allowed to read and write, at Linux level ? – Benoit Aug 14 '14 at 7:22
  • Yeah, @Benoit. That user can add folders and delete anything. The share was created under than account. – Cody Aug 14 '14 at 21:02
  • @Benoit, see OP. Put the ls -la /media/Network output in it. – Cody Aug 14 '14 at 21:07
  • cody may read under /media/Netwok but not write. Did you create this directory using sudo maybe ? In this case it is not cody who did the action but root. This is the purpose of sudo – Benoit Aug 15 '14 at 12:52
  • @Benoit The directory is an external USB hard drive, so I didn't create it. – Cody Aug 15 '14 at 18:08
2

The permissions listed here don't allow the user cody to write at Linux level but well to read.

So if you force Samba to use this Linux user when accessing the share (force user = cody), you won't be able to write either from Windows.

Evreything is owned by root from /media/Network with write access only allowed to the user owning the directory or the file, in this case root.

So what you have to do is to switch the owner of the files and directories starting with and below /media/Network to have a write access from Windows.

sudo chown -R cody /media/Network

When setting up Samba, you don't have to forgot that the read and write access coming from a Windows PC are to be translated by the smbd daemon of Samba into Linux read and write, using a valid Linux user and subject to the underlaying Linux filesystem permissions.
In your Samba configuration extract, you tell Samba to use the Linux user cody to access the directories and files under /media/Network. Forgetting about the Windows username that is passed in the connection between Windows and Samba.

  • Got an error. Function not implemented. Any idea? – Cody Aug 15 '14 at 18:10
  • Figured out that my error was because the drive was formatted to exFAT. Gonna format it and try again. – Cody Aug 15 '14 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.