24
◾
Ethical Hacking and Penetration Testing Guide
Chatter Permission
root@net:~#lsattr
---------------- ./new
root@net:~#chattr +i new
root@net:~#lsattr
----i----------- ./new
Small
i
shows that this file is unchangeable and lsattr is a command to check if there is chattr on file.
Before we end up with file permission, let’s have little look about numerical file permission.
r = 4
w = 2
x = 1
The sum of those aforementioned values manipulates the file permission accordingly, that is,
root@net:~# ls -al
-rw-r--r-- 1 ali ali 13 Mar 18 07:54 new
Here other user only having “read” permission so what we are going to do is to change it into read
and write but not execute.
root@net:~#chmod 646 new
root@net:~#ls -al
-rw-r--rw- 1 root root 13 Mar 18 07:54 new
Let’s explore a bit more into it, we want read + write permission so 4 + 2 = 6 that’s mean read and write.
Hope it is clear now how to set permission on a file and what it does.
Dostları ilə paylaş: