can not execute a script:permission denied, although it has the execution flag set (-rwxr-xr-x)

robert rottermann robert at redcor.ch
Thu Jan 20 13:26:49 UTC 2022


Colin Thanks
On 20.01.22 12:30, Colin Watson wrote:
> On Thu, Jan 20, 2022 at 07:45:53AM +0100, robert rottermann wrote:
>> in a folder on my desktop with Ubuntu 20.04 i can not execute any script
>> that has the execution flag set.
>>
>> But an attempt to run it, fails with an permission error:
>>
>> robert at chrissy:~/Dropbox/pankraz/SAPL$ ls -l startjava.sh
>> -rwxr-xr-x 1 robert robert 574 Jan 20 00:27 startjava.sh
>> robert at chrissy:~/Dropbox/pankraz/SAPL$ ./startjava.sh
>> -bash: ./startjava.sh: Permission denied
>>
>>
>> executing the same script using sh:
>>
>> sh ./startjava.sh
>>
>> works fine.
>>
>> What could be the reason?
> It's probably in a filesystem that's mounted with the noexec option.
> The output of "findmnt --target ." in that directory should tell you if
> that's the case.
>
You are perfectly right
following is the output of the above command.

/3t_disk /dev/sda1 ext4 rw,nosuid,nodev,noexec,relatime,errors=remount-ro


However I do not understan why this is so. Following is the relative entry in 
the fstab:

UUID=2a0d1320-6f96-4e09-8b25-959b5db42e57 /3t_disk  ext4 users,errors=remount-ro 
0       1


does users imply this?
What should I add to allow execution of scripts.

thanks

Robert





More information about the ubuntu-users mailing list