RHEL: Permission Denied

If you are getting permission denied when executing files that you believe you have rights to, here are some suggestions. You’ll need sudo access to do the following:

check file ownership:

ls -la

change file ownership:

chown user:group filename

add -R to change directory and everything underneath

check that your files have execute rights.
This is often missing when you upload files from Windows:

ls -la

change rights:

chmod +x filename      
      or      
chmod +x -R directoryname

finally, check SELinux context.
SELinux context is often messed up when you use a file transfer tool (ie FTP – FileZilla, SCP – WinSCP) to transfer from Windows to Linux.

ls --lcontext        or         ls -Z

compare your file/directory with other files. If you have no problems executing the other files, use them as the reference context.

chcon -R --reference otherworkingdirectory yourdirectory

Tested on Red Hat Enterprise Linux Server release 6.6 (Santiago)