Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
permission [Make my files readable ,writable but couldnot be delete] ?
Dear Everyone
i fell some critical thinking when setting permission for my files & directories on share zone(samba,ftp). i try to set their permission in such a way that a registered user can read & write but couldn't delete a file.
If you grant write access to a file, it could also be emptied. Is this what you want? Usually it’s set up by disallowing a write to the directory itself (but then they also couldn’t create a file).
I hope sticky bit solve your problem .
If you add sticky bit to parent directory of files, anyone can't remove files in directory.Only file's owner can remove files
i fell some critical thinking when setting permission for my files & directories on share zone(samba,ftp). i try to set their permission in such a way that a registered user can read & write but couldn't delete a file.
Thnaks in advance.
sorry for my bad english.
please help
you have asked same type of question in two threads....?
Ahh, that's why I referred to samba in that other one originally. I wasn't crazy after all! Thanks for pointing that out. Reporting this thread to be closed, since this thread is newer.
Ahh, that's why I referred to samba in that other one originally. I wasn't crazy after all! Thanks for pointing that out. Reporting this thread to be closed, since this thread is newer.
Well if you are closing that thread then I will repost my answer in this thread
Quote:
Originally Posted by rabir
Dear Everyone
i fell some critical thinking when setting permission for my files & directories on share zone(samba,ftp). i try to set their permission in such a way that a registered user can read & write but couldn't delete a file.
Thnaks in advance.
sorry for my bad english.
please help
I hope you know about sticky bit
You can use this
Code:
#chmod 1664 /path/to/share
or
#chmod -R 1664 /path/to/share
change the permission as per your requirements and "1" represents sticky bit
check this link for more information on sticky bit
You could also check out chattr. The advantage is that whatever attributes you change will not show with an ordinary ls, you'll need lsattr. And only root can change the attributes if you need to change them again.
Quote:
DESCRIPTION
chattr changes the file attributes on a Linux file system.
The format of a symbolic mode is +-=[acdeijstuADST].
The operator `+' causes the selected attributes to be added to the existing attributes of the files; `-' causes them to be removed; and `=' causes them to
be the only attributes that the files have.
The letters `acdeijstuADST' select the new attributes for the files: append only (a), compressed (c), no dump (d), extent format (e), immutable (i), data
journalling (j), secure deletion (s), no tail-merging (t), undeletable (u), no atime updates (A), synchronous directory updates (D), synchronous updates
(S), and top of directory hierarchy (T).
The following attributes are read-only, and may be listed by lsattr(1) but not modified by chattr: huge file (h), compression error (E), indexed directory
(I), compression raw access (X), and compressed dirty file (Z).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.