$
Lernen Linux-Handbuch
de
XP:0
Quest 37Security Auditor
+260 XP

Default Permissions & Group Ownership (umask & chgrp)

Interaktives Terminal für diese Quest starten→Keine Installation erforderlich • Läuft im Browser

Konzept & Übersicht

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.

Befehlssyntax-Referenz

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

Prüfungsziele

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

Bereit für Quest 37?