$
Apprendre Manuel Linux
fr
XP :0
Quête 37Security Auditor
+260 XP

Default Permissions & Group Ownership (umask & chgrp)

Lancer le terminal interactif pour cette quête→Aucune installation requise • S'exécute dans le navigateur

Concept et aperçu

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.

Référence de syntaxe des commandes

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

Objectifs de vérification

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

Prêt à terminer la Quête 37?