$
Learn Linux handbook
en
XP:0
Quest 37Security Auditor
+260 XP

Default Permissions & Group Ownership (umask & chgrp)

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

Concept & Overview

Whenever a program creates a new file or folder, its initial permissions are determined by the umask (user file-creation mode mask). The umask acts as a filter that strips away permissions from maximum defaults (666 for files, 777 for directories):

- Standard umask 022 subtracts group/other write permissions, yielding 644 (rw-r--r--) for files and 755 (rwxr-xr-x) for folders.
- Running umask 027 tightens security by stripping all permissions from "others", yielding 640 and 750.

To change only the group owner of a file without altering its user owner, use chgrp .

1. Run umask to view your current file-creation mask, then tighten permissions by running umask 027.
2. Change the group ownership of project.txt to the developers group using chgrp developers project.txt.

Command Syntax Reference

Command / SyntaxDescription
umaskDisplay current octal file-creation mask
umask 027Set restrictive umask to 027
chgrp developers project.txtChange group ownership to developers

Verification Objectives

These conditions will be automatically verified when you run commands inside the interactive terminal simulator:

  • ○
    Run the "umask" command
  • ○
    Set umask to 027 using "umask 027"
  • ○
    Change group of project.txt to developers using chgrp

Ready to complete Quest 37?

Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.