User Tools

Site Tools


linux:file_perm

This is an old revision of the document!


Files/directories permissions and ACL

Standard file permissions

A user can delete a file on which he isn't the owner, if he is the owner of the directory and rights on this folder allows him to write it

Ex:

manu@manu-opensuse:~> ls -ld /home/manu
drwx------ 45 manu users 4096 Aug 17 11:01 /home/manu
manu@manu-opensuse:~> ls -l test*
-rw-r--r-- 1 root root    0 Aug 17 12:01 test
-rw-r--r-- 1 manu users   0 Aug 17 12:02 test1
manu@manu-opensuse:~> rm test
rm: remove write-protected regular empty file 'test'? y
manu@opensuse:~> ls -l test*
-rw-r--r-- 1 manu users   0 Aug 17 12:01 test1

Special permissions

find / -perm /4000 -ls
find / -perm /2000 -ls

Sticky bit: only user of the file or directory is authorized to remove the file

chmod +t mydir/
linux/file_perm.1629206823.txt.gz · Last modified: 2021/08/17 15:27 by manu