How to prevent making every file in a directory executable by default?

Hi everyone,
I have a big problem with my Manjaro 21.1.2 Pahvo (KDE 5.85.0 / Plasma 5.22.5)
I have 2 storage devices on my laptop:

  1. A 256GB SSD that I installed the OS on this one
  2. a 500GB SSD that I use for my storage and keep my files on it

My problem is that every file in the 500GB drive is always executable by default and even when I remove executable permission, it will be executable again automatically!
Take a look:

Thank you

If the filesystem on the storage device is ntfs you cannot. The linux ntfs driver does not implement permissions.

Edit /etc/profile and change umask 022 to 077

# umask 022
umask 077

What filesystem is there ?

Thank you for your answer,
Yes it is NTFS
Why this is happening at all?
I made the change you said, But nothing changed

Thank you andreas85
Does this image contain enough info for you?

Because it is not a native Linux file system. NTFS can’t store Linux file permissions. The permissions you see are just emulated by the userland driver. There is a option that can change it at mount time. However, it will be for all files the same and it can’t be changed without remount of the filesystem. Programs like chmod , chown , … will not work. Since you need to specificity the options you need to use the mount command, or a systemd mount unit (or a fstab entry).

Thank you for your help
I changed the drive file system to ext4 and now it is OK :smiley:

As I said nfts does not support permissions. So other than reformatting the device as you did - there is nothing you can do.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.