how i can change file permissions to read,write and modify but not to delete in linux
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how i can change file permissions to read,write and modify but not to delete in linux
Hi Team
I am working as a sytem adminstrator and need some suggestion from your side. I want to change file and directory permission to read,write and modify but not to delete them by the user in linux.
All the users logged in to samba server by rncit and i have to restrict them not to delete any file or directory.
I have shared the following Path:/home/rncit in samba server.
please do the needful as it is urgent.
According to the situation you have given, it points towards sticky bit. But remember, sticky bit is applicable for directories only, not useful on files. However, after applying sticky bit on a directory, the content within the directory can be deleted by file owner, directory owner or root only. After that, you can assign all read/write/execute permission to all.
One other thought would be to use inotifywait to watch for file a being closed, and then immediately copy that file appending a time stamp to a directory that the users cannot access. If a file was subsequently deleted, you would still have a copy of the original.
thanks a lot.
I got the point but sticky bit allow only the file owner to read,write and delete but I have around 500 users to access the samba server.
please suggest me how i can manage it by group id or userid, i am using 6.2 linux version for samba.
can i need to create individuals userid for the same?
@Boby:
If you do not wish to allow everyone to have read/write, then create a new group, add it as main group for the directory as well as files. And then add only those users to that group whom you wish to allow read/write permissions.
thanks a lot for the same.
Please take out the steps that how i can add users in the same group and the only group permissions will be inhert by the users?
Actually I have to Create 3 groups as DII&V,E2E and OAM and want to read,write and delete permissions for these groups.
please do the needful.
However, these are very basic commands, and as a system admin you should know them very well. If you would have even checked the manuals of these command, you didn't need to ask for it.
Last edited by shivaa; 03-20-2013 at 09:32 AM.
Reason: Links added
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.