Who is the best user to be the owner of shared files?

2

I installed Debian on a home computer which will be used as a NAS. The server will share a folder with computers using Ubuntu or Windows 7 (I use a dual-boot). Should I chown all the shared folder and sub-folders to my username or another user (for example nobody)?

On a previous NAS, I had some problems with shared folders, I executed chmod 777 -R on all the files but I still had problems with Windows 7. I was only able to read folders and files, the files weren't writable.

Update: setting my username as the owner of the files may not be the best solution since the files will have to be accessible to a DLNA server.

A.L

Posted 2014-01-20T18:26:32.543

Reputation: 509

Answers

1

This really depends on your setup. In my configuration, all the shared files are owned by my user. I have 6 users on the system, and dish out files via Samba and DLNA.

In Samba, you can configure it via the /etc/samba/smb.conf configuration to allow read or write access to anyone and everyone, or configure it for only the current owners. If you use the allow users = @group or write users = @group, it adds those permissions, assuming Samba is running as root. To use the file-system permissions, use the inherit permissions = yes option on the share.

For DLNA, I used miniDLNA, and it reads all the files just fine. I configured what folders I wanted, and what type of content was in it. It then dished out the files for me, not worrying about permissions (I assume it runs as root).

If you do not care about who has access to general shared files, create a group for everyone you actively want to access your files, then assign the files to that group (i.e. sudo chown -R :groupname /mnt/share/files). Then when you add a user (if you do), you just add them to the group in /etc/group, and they have access to the files! Make sure you also set chmod -R 770 /mnt/share/files to make sure anonymous people don't see the files.

Canadian Luke

Posted 2014-01-20T18:26:32.543

Reputation: 22 162

1

In the case of shared files the owner/permissions is less important than the group/permissions. While it is entirely possible to do what you want with the standard Unix style file permissions schema it may be difficult. ACL (Access Control List) is a more flexible alternative to Unix file permissions, especially when it comes to sharing files among multiple users.

Here is a brief how to for installing ACL on a Debian system:

http://www.debianhelp.co.uk/acl.htm

ubiquibacon

Posted 2014-01-20T18:26:32.543

Reputation: 7 287