Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 636  / 1 Year ago, sat, december 17, 2022, 10:02:21

I've read a little about chmod and have a high-level understanding of file permissions. But I'm a little confused about the concept of an 'owner'.



If my user account is the 'Owner' of a directory but it has no permissions (chmod 0000) does my user have any more ability to do anything than another random user on the system? Assuming neither user is a super user?


More From » permissions

 Answers
5

chmod 00000 makes the directory/file inaccesable to owner and group. The only thing you and the group that owns the file can do is remove it with rm -rf tmp/. Nothing better than an example:



$ mkdir tmp
$ chmod 00000 tmp
$ cd tmp
bash: cd: tmp: Permission denied


You can see the directory with ls -l



d--------- 2 rinzwind rinzwind   4096 Oct 13 14:35 tmp


and but only with sudo permissions can you enter the directory ...



 $ sudo su
# cd tmp
#





Regarding the other posts: yes you can remove a file/dir that is chmodded to 00000:



$ mkdir tmp
$ chmod 00000 tmp
$ rm -rf tmp/
$ touch 1
$ chmod 00000 1
$ rm 1
rm: remove write-protected regular empty file `1'? y
$





As the owner you are also allowed to reset the permissions. That is something someone else (except for root) is allowed too.


[#34980] Saturday, December 17, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enincroscope

Total Points: 252
Total Questions: 124
Total Answers: 104

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
enincroscope questions
Thu, Jan 20, 22, 08:33, 2 Years ago
Thu, Apr 7, 22, 01:09, 2 Years ago
Mon, May 16, 22, 09:08, 2 Years ago
;