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

Colin Watson cjwatson at ubuntu.com
Thu Jan 20 11:30:09 UTC 2022


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.

-- 
Colin Watson (he/him)                              [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list