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?

top 13 comments
sorted by: hot top controversial new old
[-] ZWQbpkzl@hexbear.net 1 points 12 hours ago

Can't explain why your file browser doesn't work and I don't suggest logging into your desktop as root. You should take steps to make that impossible, in fact.

Now you said this doesn't work

sudo chmod -v +x filename.sh

And that's baffling. What is the exact error message and output of that command? Also is the file in question in a weird place or on a weird filesystem?

[-] possiblylinux127@lemmy.zip 11 points 1 day ago* (last edited 1 day ago)

First off don't log in as root

What file system is the file under? What are the results of ls -l?

[-] Babalugats@feddit.uk 2 points 14 hours ago

Results of ls -l

total 27040
-rw-r--r-- 1 user user 27560272 Apr 13  2021 'Commandos 2 HD Remaster'
drwxr-xr-x 7 user user    32768 Apr 24  2021 'Commandos 2 HD Remaster_Data'
-rw-r--r-- 1 user user      200 Apr 24  2021  run.sh
-rw-r--r-- 1 user user     2465 Mar  3  2021  uninstall.sh
[-] possiblylinux127@lemmy.zip 2 points 12 hours ago

Can you try copying the file to a different name?

ie cp filename filename2

[-] a14o@feddit.org 7 points 1 day ago

The partition containing the files may be mounted readonly. Check less /etc/mtab for an ro option on that entry.

[-] Babalugats@feddit.uk 1 points 14 hours ago

This is the result for sda3 /dev/sda3 /media/user/8ACB-8EB4 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0

[-] Jumuta@sh.itjust.works 5 points 12 hours ago

oh yeah I don't think vfat can do file permissions

[-] Maiq@piefed.social 5 points 12 hours ago

vfat doesn't allow linux permissions and ownership.

[-] bobo1900@startrek.website 4 points 1 day ago

Also, at least for ext4 filesystems, probably many others, there's an option (noexec) that prevents any execution. Might be worth checking that

[-] nymnympseudonym@piefed.social 5 points 1 day ago

That wouldn't prevent the chmod, just would refuse to execute even if the file is a+x

[-] Maiq@piefed.social 4 points 1 day 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.

[-] Babalugats@feddit.uk 1 points 14 hours ago* (last edited 14 hours 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.

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

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

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

Linux Questions

3018 readers
35 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