File Permissions
I have file in my home directory.
I want other users on this system to be able to read from this file and write to this file. But I don't want anyone to be able to delete this file. How can I do this? |
I guess what you want is not really possible. If you give write permission to a file, the person also has the right to delete it.
|
well This is possible, This happens the case with /tmp directory.
The non-owner user will not be able to delete it even if it has got 777 permission. check the permission on /tmp directory. If am not sure wether you will be able to achieve what you exactly want but this is possible Thats basically is sticy bit on /tmp i.e the last t in the permissions. Explore over it. |
It is possible, with the use of sticky bit. If you set it on a directory, then files inside that directory can only be renamed or removed by the owner of that directory, even if other users have write permissions to the files there.
Code:
chmod +t /home/username/dirname Code:
ls -ld /tmp |
Allowing other users to access your home directory isn't a good idea. Put a copy of the file in /tmp/ or a publicly accessible directory which has the sticky bit set. In order to access this file, they would need rx permissions on the parent directory.
|
If this file is on an ext2 or ext3 filesystem, then you could use chattr +u.
This would make the file undeletable. |
All times are GMT -5. The time now is 02:31 AM. |