What can i say, this one is real stupid and bad mistake...
It screenshot of one of repository of Cambridge OpenLabTools (yes, you read it right, that Cambridge) in github (reference: https://bitcointalk.org/index.php?topic=1707546.msg21134487#msg21134487 ).
What so wrong is:
chmod a+x simple_bash.sh //Make it executable
Right after it was created, every new file should have 644 permission, with above command, file permission become 755, so above command is normal although it can be achieve also with just:
chmod +x
Next command is where stupidity comes into place:
chmod 777 simple_bash.sh //Give it root rights (saves you to write sudo every time)
Above command change file permission (again), and makes it readab;e, executable, and writeable by the whole world, and the comment is not less ridiculous:
Give it root rights (saves you to write sudo every time)
It's wrong statement on all aspects:
- anyone who access that file will not be granted root's rights
- running a program as a normal user is totally different with sudo (run with rood rights)
RTFM, learn some more before you code, make howto, or anything related to Linux/*nix, don't just take a shortcut, you might hurt yourself and/or others...