Results 1 to 4 of 4

Thread: Umask Values

  1. #1
    Join Date
    Aug 2024
    Beans
    11

    Umask Values

    Hello forum,


    What would be the umask value for giving a file rwx rights to the user, group and others?

    I know 000 does the following:

    Code:
    000 File:rw-rw-rw- Directory:rwxrwxrwx
    But I could not find a way to grant execute rights while using the umask mode.

  2. #2
    Join Date
    May 2018
    Location
    Here and There
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Umask Values

    umask is subtractive, not prescriptive: permission bits set in umask are removed by default from modes specified by programs, but umask can't add permission bits. touch specifies mode 666 by default (the link is to the GNU implementation, but others behave in the same way; this is specified by POSIX), so the resulting file ends up with that masked by the current umask: in your case, since umask doesn't mask anything, the result is 666.


    The umask acts as a set of permissions that applications cannot set on files. It's a file mode creation mask for processes and cannot be set for directories itself. Most applications would not create files with execute permissions set, so they would have a default of 666, which is then modified by the umask.


    More Info: https://www.cbtnuggets.com/blog/tech...a-crash-course

    My session now is:
    Code:
    umask
    0007
    ┌───────────────────>
    │~ 
    └─> umask -S
    u=rwx,g=rwx,o=
    Or
    Code:
    ─> umask 027
    ┌───────────────────>
    │~ 
    └─> umask -S
    u=rwx,g=rx,o=
    That link has a lot of good info to digest.
    "When you practice gratefulness, there is a sense of respect toward others." >>Dalai Lama

  3. #3
    Join Date
    Aug 2024
    Beans
    11

    Re: Umask Values

    Thanks for the thorough explanation...

  4. #4
    Join Date
    May 2018
    Location
    Here and There
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Umask Values

    Your Welcome, hope that answers most of your questions with umask
    "When you practice gratefulness, there is a sense of respect toward others." >>Dalai Lama

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •