Setting up permissions on a script
The chmod command (change mode) is a shell command in Linux. It can change file system modes of files and directories. The modes include permissions and special modes. Each shell script must have the execute permission. Mode can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.
Examples
Allowing everyone to execute the script, enter:
chmod +x script.shOR
chmod 0755 script.shOnly allow owner to execute the script, enter:
chmod 0700 script.shOR
chmod u=rwx,go= script.sh
OR
chmod u+x script.shTo view the permissions, use:
ls -l script.sh
Set the permissions for the user and the group to read and execute only (no write permission), enter:
chmod ug=rx script.sh
Remove read and execute permission for the group and user, enter:
chmod ug= script.sh
More about chmod
Type the following command to read chmod man page:
man chmod
Please note that script must have both executable and read permission.