Controlling File and Directory Permissions
55
So, if you want to remove the write permission from the user that the
file
hashcat.hcstat belongs to, you could enter the following:
kali >
chmod u-w hashcat.hcstat
This command says to remove (
-
) the write (
w
) permission from
hashcat
.hcstat for the user (
u
).
Now when you check the permissions with
ls –l
again, you should see
that the
hashcat.hcstat file no longer has write permission for the user:
kali >
ls -l
total 32952
drwxr-xr-x 5 root root 4096 Dec 5 10:47 charsets
-r-xr-xr-- 1 root root 33685504 June 28 2018 hashcat.hcstat
-rw-r--r-- 1 root root 33685504 June 28 2018 hashcat.hctune
drwxr-xr-x 2 root root 4096 Dec 5 10:47 masks
drwxr-xr-x 2 root root 4096 Dec 5 10:47 OpenCL
drwxr-xr-x 3 root root 4096 Dec 5 10:47 rules
You can also change multiple permissions with just one command. If
you want to give both the user and other users (not including the group)
execute permission, you could enter the following:
kali >chmod u+x, o+x hashcat.hcstat
This command tells Linux to add the execute permission for the user
as well as the execute permission for others for the
hashcat.hcstat file.