Читать книгу Kali Linux Penetration Testing Bible - Gus Khawaja - Страница 28
TIP
ОглавлениеThe dot in the previous example means the current directory.
Indeed, the root has no permission to execute it, right? To change the permissions of the previous file based on the formula ( r
=4, w
=2, and x
=1), use this:
User:4+2+1=7; Group:4+2+1=7; Everyone:4
Then, use the chmod
command to get the job done (this time, you should be able to execute the shell script):
$chmod [permissions numbers] [file name] root@kali:~# chmod 774 test.sh root@kali:~# ls -la | grep 'test.sh' -rwxrwxr-- 1 root root 10 Sep 22 11:25 test.sh root@kali:~# ./test.sh test root@kali:~#
There is another shortcut for this, which allows the execution of a file instead of calculating the numbers of each. We just need to add +x
to the chmod
command (but be careful because when you execute this one, you will be giving the execution permission to everyone as well):
$chmod +x [file name] root@kali:~# chmod +x test.sh root@kali:~# ls -la | grep 'test.sh' -rwxrwxr-x 1 root root 10 Sep 22 11:25 test.sh