8

I am not sure how many files that this happens to, but it has happened to two that I have tried in the last few days, one .sh file and another program/executable. I am logged in as root - Linux Mint 21.2 When I try to allow executing as a program it unticks itself (as in this video) I also get 'permission denied' in terminal, as root and i have tried

chmod +x filename

and

sudo chmod -v +x filename.sh

sudo chown --verbose 1000 filename.sh

But still get denied.. What am I doing wrong here or how can I fix this?

you are viewing a single comment's thread
view the rest of the comments
[-] Maiq@piefed.social 4 points 1 month ago

Not really sure whats going on here. Some info that might help might be.

  1. Is the script supposed to be run as root?

If so try sudo chown root:root filename.sh. If it is not to be run as root try sudo chown $USER:$USER filename.sh

  1. What is the permissions does the file have? ls -lg?

  2. Does the file have a shebang #!/usr/bin/env bash?

That's all I got. If this doesn't help someone will come along soon that will have better ideas.

[-] possiblylinux127@lemmy.zip 4 points 1 month ago

It might also be that the #! points to non executable file

[-] Babalugats@feddit.uk 1 points 1 month ago* (last edited 1 month ago)
sudo chown root:root run.sh
[sudo] password for user:          
chown: changing ownership of 'run.sh': Operation not permitted

and the latter does nothing. Or seems not to anyway.

this post was submitted on 21 Dec 2025
8 points (90.0% liked)

Linux Questions

3317 readers
2 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS