can not execute a script:permission denied, although it has the? execution flag set (-rwxr-xr-x)
Robert Heller
heller at deepsoft.com
Thu Jan 20 19:16:56 UTC 2022
At Thu, 20 Jan 2022 18:56:36 +0000 "Ubuntu user technical support,? not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:
>
> On Thu, Jan 20, 2022 at 02:26:49PM +0100, robert rottermann wrote:
> > On 20.01.22 12:30, Colin Watson wrote:
> > > 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?
>
> Yes, see "man mount":
>
> This option implies the options noexec, nosuid, and nodev (unless
> overridden by subsequent options, as in the option line
> users,exec,dev,suid).
>
> > What should I add to allow execution of scripts.
>
> Minimally, change "users" to "users,exec". You might also consider
> whether you actually need non-root users to be able to mount/unmount
> this filesystem; perhaps replacing "users" with "nodev,nosuid" would be
> better.
Some explaination: "users" in the mount options generally is used for user
supplied removable media (eg thumb drives or optical disks). Since the
provendence of this media is unknown it makes sense to restrict people from
running random programs from who knows where.
If this is a permanently attached disk, either mount it at boot time (by root)
or use autofs to mount it (again by root, but in the autofs's deamon's
context). (I use the latter to mount uncommonly used disks / partitions /
volumes.)
>
--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller at deepsoft.com -- Webhosting Services
More information about the ubuntu-users
mailing list