You are not logged in.

#1 2021-11-28 17:05:45

dankcuddlybear
Member
Registered: 2021-10-24
Posts: 11

File/folder permissions (all files are executable & cannot chown)

I'm having problems with these directories:
/home/dankcuddlybear (my home directory) on the ext4 root partition on my SSD
/public which is also on the ext4 root partition on my SSD
/media which is an NTFS partition (so I can access files from Windows 10) on my HDD

For some reason, ALL files are executable, not just scripts and binary programs. I want only the scripts and binaries to be executable. Not only is this bad for security, I get prompts whenever I try and open these files saying that they're executable and to only run programs from trusted sources, blah blah blah... I tried using chmod to grant read/write permissions ONLY using

$ chmod -R 600 /home/dankcuddlybear

but then I'm denied access to my files. I tried creating another user account "guest" and that account did not have this problem.

Also, all files in /media are owned by root, and

# chown -R dankcuddlybear:dankcuddlybear /media

does nothing to change that.

Last edited by dankcuddlybear (2021-11-28 19:25:01)

Offline

#2 2021-11-28 22:40:06

seth
Member
Registered: 2012-09-03
Posts: 26,666

Re: File/folder permissions (all files are executable & cannot chown)

The NTFS ownership is selected w/ the mount options and flattened.
https://wiki.archlinux.org/title/NTFS#udisks_support

"chmod -R 600" is not what you want to do, because it removes the executable bit from the directory(s) - you want to "chmod -R u+rwX" to restore directory access, but your scripts won't be automatically turned executable (so you'll have to u+x them by  glob pattern/suffix or inspect them for the shebang)
https://man.archlinux.org/man/core/coreutils/chmod.1.en

Offline

Board footer

Powered by FluxBB