I learned the hard way that the “x” permission on directories doesn’t mean “execute” but “traverse”. And setting permissions on directories get’s them inherited by newly created/added files in there, right?

So how can i remove the ability from my homedir to execute current and new files but keep the traverse permission?

  • IsoKiero@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    3
    ·
    19 days ago

    And setting permissions on directories get’s them inherited by newly created/added files in there, right?

    No. They’re created based on ‘umask’ and changing directory permissions doesn’t automatically change permissions on underlying files (unless you set privileges recursively) nor new files in the directory.

    So how can i remove the ability from my homedir to execute current and new files but keep the traverse permission?

    For new files set your umask on what you want. By default it’s usually either 0002 or 0022. For existing files you can use find: find ~ -type f -exec echo chmod a-x {} \; (remove echo once you’ve confirmed that it does what you want).