1

I am unable to run scripts that I previously had been doing:

$ SCRIPT.SH
bash: /media/USER/PATH/bin/SCRIPT.SH: Permission denied

Checking the file permissions and ownership, that are as expected:

$ ll PATH/bin
total 1
-rwxr--r-- 1 USER USER 1425 Aug  5 09:23 SCRIPT.SH

I have also tried running the scripts with sudo, and even given a test script full permissions:

chmod u=rwx,g=rwx,o=rwx SCRIPT.SH

Everything leads to the same bash: Permission denied message

Background: The scripts are located on a USB HDD, as they were when they could be run.
What has changed is: the drive label,
The updated .bashrc PATH entry for the 'new location'
PATH="/media/USER/MOUNTDIRECTORY/bin:$PATH"

And so the volume was mounted at the same 'named' place, an fstab entry
UUID=UUID /media/USER/MOUNTDIRECTORY ext4 defaults,user,auto 0 1

I'm clearly missing something!

Broadsworde
  • 3,922
  • 4
  • 27
  • 45
  • 1
    Unmount that filesystem and remove the mount option `user` as it implies `noexec` which will prevent binary executable e.g. `/bin/bash` from running on that virtual filesystem mount ... Then, mount it again and it should work.. – Raffa Aug 05 '23 at 12:17
  • 2
    or alternatively, add the `exec` option after `user` like `defaults,user,exec,auto` – Raffa Aug 05 '23 at 12:23
  • 1
    ... see for example [Why am I still unable to run a script on NTFS partitions after remount with suitable perssimions?](https://askubuntu.com/questions/780233/why-am-i-still-unable-to-run-a-script-on-ntfs-partitions-after-remount-with-suit) – steeldriver Aug 05 '23 at 12:24
  • 1
    @Raffa, thank you so much, that seems to have worked nicely. A valuable lesson there, I knew I should have dug deeper into the fstab settings! – Broadsworde Aug 05 '23 at 12:24

0 Answers0