I have been following this iptables guide online and came across a problem where I tried to give myself execute permissions to a file that is owned by root and stored in root's home folder. Here is the online document as a reference: iptables guide
It says:
Make sure you can execute the script
$ chmod +x /root/fw.stop
And then:
You can run the script
$ /root/fw.stop
When I entered the command "chmod +x /root/fw.stop", I received an error "chmod: cannot access `/root/fw.stop': Permission denied".
Obviously, if I want to run the script, I can do so by simply typing "sudo /root/fw.stop", but I'm trying to learn; did the writer of the guide just make a mistake with his syntax that he listed, or am I doing something wrong?
I tried "sudo bash -c "chmod +x /root/fw.stop"" and then tried to run the script again as myself with the command "/root/fw.stop" but I received the error "bash: /root/fw.stop: Permission denied".
$
prompt, which is what I assume you were referring to. I have added it.