Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-4832

RH199-328: Ch04s05 : step 8.1 suggests umask as 0002 upon switching from root

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • RH199 - RHEL9.0-en-4-20221003
    • RH199
    • None
    • ROLE
    • en-US (English)

      URL: https://rol.redhat.com/rol/app/courses/rh199-9.0/pages/ch04s05
      Reporter RHNID: ctiwary@redhat.com
      Section: 5 - Lab: Control Access to Files
      Language: en-US (English)||||||||
      Workaround:

      Description: Ch04s05 : step 8.1 suggests umask as 0002 upon switching from root :

      "AFAIK , When you switch to a different user using the su command, the new user inherits the environment of the previous user, including the umask setting. In your case, since you logged in as root and then switched to the student user using su, the student user inherits the umask setting of the root user, which is 0022.

      The umask value is not a user-specific setting, but rather a system-wide default for creating new files and directories. The value of umask is inherited by child processes, including shells, so the setting will remain the same throughout the lifetime of the process, unless it is explicitly changed.

      If you want to set a specific umask value for a particular user, you can add the umask command to the .bashrc or .bash_profile file of that user. This will set the umask value to the desired setting every time the user logs in or opens a new shell. However, it is important to note that any processes or scripts launched by the user will inherit the umask value of the parent process, so changing the user's umask setting may not have the desired effect on all files and directories created by the user."

            rht-sbonnevi Steven Bonneville
            chetan-rhls Chetan Tiwary
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: