Interview Prep/Linux/Permissions, ownership, SELinux and mounts

A script fails with `bash: ./deploy.sh: Permission denied` even though `ls -l` shows `-rwxr-xr-x`.

BeginnerTroubleshootingPermissions, ownership, SELinux and mounts
Answer

Likely causes → The filesystem is mounted with noexec (common on /tmp, /home or USB/NFS mounts).

Diagnose →

findmnt -no OPTIONS --target ./deploy.sh

Fix → Run it through the interpreter (bash ./deploy.sh), or move it to a filesystem without noexec. Don't drop noexec from /tmp just for this.

Prevent → Keep scripts in /opt or /usr/local/bin; set TMPDIR for installers that execute from /tmp.

All Linux questions Roadmap: Linux

More on Permissions, ownership, SELinux and mounts