Bash Script Permission Denied when tying to run
As we can see from the output of findmnt -T .
, the filesystem on which the script is stored is mounted with the noexec
option. This prevents scripts (as well as binary executables) from being executed directly, whereas bash bash_script1.sh
still works because the bash
executable is stored elsewhere and only needs to read the script.
To modify the behavior temporarily you can use the mount
command:
sudo mount -o remount,exec /home
To make the change persistent, you will need to modify your /etc/fstab
file and remove the noexec
mount option for this block device.