https://drive.google.com/file/d/1bMW0FFozaNIqTOMCbp_5SV-v71U7t3Gx/view?usp=sharing

1. Understanding umask (Default Permissions)

Explanation

umask defines the default permissions for newly created files and directories by masking (subtracting) permissions from the maximum.

Common umask Values

umask File Permissions Dir Permissions Use Case
0022 644 (rw-r--r--) 755 (rwxr-xr-x) Default for most systems
0077 600 (rw-------) 700 (rwx------) Private files (no group/others access)

Commands

umask -S                # Show symbolic form: u=rwx,g=rx,o=rx
umask 0077              # Set restrictive default
umask 0022              # Set standard default

Lab Steps

  1. Check current umask:

    umask -S
    
    
  2. Create a file and check permissions:

    umask 0077
    touch private.txt
    ls -l private.txt    # Should be -rw-------
    
    

Tips & Warnings


2. Special Permission Bits

Sticky Bit (+t)