I am basically really new at Kali and I have no previous experience in other OS other than Windows. I am trying to learn Kali using various tutorials on Youtube and I was basically learning ipsweep (I think it is called that only ) using .sh file programmed in /bin/bash, i tried to make a file executable in root using the
chmod -x filename.sh
sudo chmod -x filename.sh
chmod -rwx filename.shI thought I didn't have enough permissions because it showed no bash error but when i tried ./filename.sh it said permission denied. Then I saw if the file is executable or not but it showed something rather strange: it showed that the chmod command wasn't even executed (I think i am still very bad at understanding this). How to do this right?
1 Answer
chmod -x removes the execute permission. If you want to make the file executable you need +x:
chmod +x filename.shFurthermore the file needs to be readable (chmod +r filename.sh). With chmod -rwx filename.sh you have removed all the permissions, including this one. The dashes (which are displayed in your terminal as one long line) in the output of ls -l indicate chmod worked perfectly.