[SOLVED] How can any user remove a file created by other user with all permissions(777)?
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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 can any user remove a file created by other user with all permissions(777)?
I am new on Linux using ubuntu 12.04. I created three users user1, user2, user3 in same computer.
User1 created a file in its home/general with permissions rwxrwxrwx(everyboy have all permissions). I changed the user from user1 to user2 in user1 area. I want to use delete the file created by user1 in user1/home by using user2. Briefly user2 removes user1's file but I am getting warning of there is no permission.
I will be really appreciated if enligted me.
Removing (or creating) a file is an operation on the directory. You would need to give user2 write permission in the directory (and that might well be more permission than you wish to give).
I created three users user1, user2, user3 in same computer.
User1 created a file in its home/general with permissions rwxrwxrwx(everyboy have all permissions). I changed the user from user1 to user2 in user1 area. I want to use delete the file created by user1 in user1/home by using user2. Briefly user2 removes user1's file but I am getting warning of there is no permission.
deleting a file involves a write access to the directory containing that file. So, to delete a file, you need to have write permission to the directory containing it.
Btw, I don't think your approach isn't a good one. Okay, it's no problem to share directories with other users. But being that generous about "everybody's" permission can be dangerous.
If two or more users work together on a project, I'd rather create a new group and put these users into it. Then, assign the shared directory to that group, and grant the group full access to the directory and the files in it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.