- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Re: ReadyNAS102 - protection of truecrypt-file against delete
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ReadyNAS102 - protection of truecrypt-file against delete
All my data on RN102 are saved in one truecrypt-file -"truecrypt_dad"- created on a laptop (OS Debian 8). This means that the RN102 manages only one file -"truecrypt_dad"-.
With the below described permission structure both users "dad" and "mom" can read and write the file "truecrypt_dad" from the laptop (OS Debian 8).
I want to protect the file "truecrypt_dad" against delete from user "mom", but I cannot find a solution.
MY PROBLEM: The user "mom", by attempting to delete "truecrypt_dad" does receive an errore message - "permission denied - you have not sufficient permissions to move the file into the trash" (free translated from german) - which is OK for me. But on the same window the button "DELETE" is still active and the user "mom" can delete the file!. To complete the confusion the user "mom" cannot rename the file due to insufficient permissions, which is also OK for me.
On one side the user "mom" cannot rename (OK for me) and cannot move into trash (OK for me), but on the other side can delete (not OK for me) the file.
I want to protect the file "truecrypt_dad" against delete from user "mom". There is a solution and an explanation for the strange behaviour mentioned above?
Thank you.
Technical data
Laptop description: OS Debain 8
extract from /etc/fstab of user "dad"
#nas
//IP/dad/ /media/dad cifs users,noauto,username=dad,passwd=dad 0 0
extract from /etc/fstab of user "mom"
#nas
//IP/dad/ /media/dad cifs users,noauto,username=mom,passwd=mom 0 0
NAS description: ReadyNAS102, Firmware 6.6.0, 2x 2TB
Configuration after factory reset:
SSH: activated
USERS/GROUPS
User Group comment
admin admin default user
dad parents
mom parents
SHARES
file/directory owner group permissions comment
/data root root drwxr-xr-x default share; default permissions
/data/dad dad parents drwxrwx--T+ ACLs and Sticky-bit created by RN102; ALSs: rwx for admin
/data/dad/truecrypt_dad dad parents -rwxrwx---+ file created with tuecrypt on laptop
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
Try changing the permissions on the dad directory so that the group doesn't have write permission.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
Thank you for your reply.
Both users "dad" and "mom" shall access to the file "truecrypt_dad". Only the user "dad" shall have the permission to delete "truecrypt_dad".
The question is: why is the user "mom" allowed to delete the "truecrypt_dad" if there are no permissions to rename it and move it into trash? Why is "DELETE" still active? I cannot understand this behavior.
If "DELETE" would not be active than everything would be fine for me.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
@merlinux16 wrote:
Why is "DELETE" still active? I cannot understand this behavior.
Linux doesn't have a separate "delete" permission. Deleting a file is done by modifying the folder the file is in. If you give someone write permission to that folder, then you are giving them permission to delete the files in it.
You are allowing mom the ability to write to /data/dad (since anyone in the parents group has that permission).
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
You should be able to make the share read-only for mom (or perhaps "everyone") and read/write for dad via the network settings for the share. That should block mom's ability to delete the file. It should also prevent mom from writing to the file.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
I'm able to make the share read-only for mom and read write for dad via the network settings for the share. This is not the problem. But I want that mom can write but cannot delete. This is a typical requirement for workgroups and not only an idea of mine. In a normal Linux system this is made with the sticky bit. If the stick bit is set on a directory, than only the owner can delete the files inside, even if the group has write permissions.
The NAS system has set automatically the sticky bit to /data/dad, this is the "T" in the permissions "drwxrwx--T+". But it works only partly, because as described in the first post, the user mom can write but cannot rename and cannot move the file into trash. I wrote also that the user mom get an error message by attempting to rename and to delete, even if mom has read write permissions via the network settings for the share. It means that the sticky bit is working, but not completely. For a reason which is not clear to me in the same error message the button delete is active and mom can delete. The sticky bit works only partly and I don't understand why. Only the network settings for the share have an influence on button delete. On the NAS is only network SMB activated. Is it samba? Do the network settings change the samba-permissions? Is it possible to activate the sticky bit via samba-permissions?
Thanks again for your support
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: ReadyNAS102 - protection of truecrypt-file against delete
@merlinux16 wrote:
I'm able to make the share read-only for mom and read write for dad via the network settings for the share. This is not the problem. But I want that mom can write but cannot delete. This is a typical requirement for workgroups and not only an idea of mine. In a normal Linux system this is made with the sticky bit. If the stick bit is set on a directory, than only the owner can delete the files inside, even if the group has write permissions.
Is "grant rename and delete" checked on the file access tab? Though it says "NFS and AFP" you should probably still uncheck it.
If that doesn't work you might need to look at (and modify) the acl for the share from ssh. You could also try putting the file inside of a subfolder, and set the sticky bit there. The share itself is a btrfs subvolume, and might behave a bit differently from a normal folder.