[SOLVED] File permissions and ownership getting screwed up
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.
Hi there
here is interesting problem scenario.Before mentioning it , I have searched first over the internet about the solution but somehow I was not locate it or find it.
Scenario:
OS:CentOS
There is directory named "data" with permission
I don't think there is a way of doing this unfortunately. The permission for creating a file and deleting a file is the same (w), so I don't think you can allow the same user to create files without allowing him to remove them.
Hi there
here is interesting problem scenario.Before mentioning it , I have searched first over the internet about the solution but somehow I was not locate it or find it.
Scenario:
OS:CentOS
There is directory named "data" with permission
one possibility would be to use incrond. to monitor that directory and change the permissions after file creation accordingly. However, the user would then not be able to write to that file either. I am not sure, if it is possible to configure incrond to discriminate between the 'rm' command and any other command that tries to gain write access to that file.
So check the man pages of incrond thoroughly.
There are far more ways to delete files. You can make a simple Perl script to delete a file.
Hi,
see the [EDIT] of my post.
Quote:
There *might* be some ugly solution for your problem.
Emphasis is on 'might' and 'ugly'.
I am not sure IF it is possible to achieve this in a robust, 100% reliable manner. However, I can think of some possibilities which *might* work. Before I explore them any further, I need some feedback from the OP. Maybe the OP just expressed himself unclear and simply setting the sticky bit would suffice for his purposes. Maybe it is sufficient for the OP to just keep the users from deleting/accessing each others files.
Well I tried to use sticky bit however when a user creates a file he owns that file and sticky bit allows to delete that file by only owner of that file or superuser.
hence sticky bit is out of league .
Well I tried to use sticky bit however when a user creates a file he owns that file and sticky bit allows to delete that file by only owner of that file or superuser.
hence sticky bit is out of league .
Well thats what i thought ur original query was, only owner should be able to delete the file.....
Well thats what i thought ur original query was, only owner should be able to delete the file.....
Thanks for reply and your time .
Well, the question or expected help is like this :
members of group FH can create the files but they should not own them i.e.whatever they create should be owned by User "YAT" in this case, and group of that file should be "FH".
Is it possible. Well unintelligent way is to change the permission of those file every time users create anything in it. which is unimaginable.Thus Is there any other way to tackle this issue ??
Thanks for reply and your time .
Well, the question or expected help is like this :
members of group FH can create the files but they should not own them i.e.whatever they create should be owned by User "YAT" in this case, and group of that file should be "FH".
Is it possible. Well unintelligent way is to change the permission of those file every time users create anything in it. which is unimaginable.Thus Is there any other way to tackle this issue ??
well then its no i would say, because
if members of FH are creating the file to be owned by YAT thats illogical coz when some1 crates a file then he/she has to be an owner of the file(creater of file is the owner no other option.)..thats the only option.
the only option is "chown" after the file is created...infact thats tthe only option.
members of group FH can create the files but they should not own them i.e.whatever they create should be owned by User "YAT" in this case, and group of that file should be "FH".
Is it possible.
Yes, have a look at incrond as I already stated. Properly configured this daemon will handle file creation and changing owner to "YAT".
Quote:
Well unintelligent way is to change the permission of those file every time users create anything in it.
Having no idea and still judging things as unintelligent does not seem smart either ...
The daemon will automatically take care of changing file permissions accordingly, however, you still haven't provided any info if after file creation the users will still need to access the file for writing.
I am getting the impression that you do not read the suggestions provided very carefully.
Yes, have a look at incrond as I already stated. Properly configured this daemon will handle file creation and changing owner to "YAT".
Having no idea and still judging things as unintelligent does not seem smart either ...
The daemon will automatically take care of changing file permissions accordingly, however, you still haven't provided any info if after file creation the users will still need to access the file for writing.
I am getting the impression that you do not read the suggestions provided very carefully.
I'm working on incrond ,"Nobody cares what you think and what impressions you get. In plain and simple English "MIND YOUR OWN BUSINESS AND STOP MAKING ANY PERSONAL COMMENT. MAKING ANY SUCH DOES NOT INTELLIGENT EITHER If person is willing to help it has be without any fuss.Thanks for reply
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.