Soru

Zorluk: OrtamacOS and Linux Operating System Features and Tools

A Linux system administrator needs to configure permissions for a newly deployed web application directory at `/var/www/app`. The administrator must recursively change the ownership of all files and subdirectories within `/var/www/app` to the user `appuser` and the group `webgroup`. Additionally, the administrator must recursively restrict directory access so that only the owner has full read, write, and execute permissions, while group and other users have no permissions. Which TWO of the following commands must the administrator execute to fulfill these requirements?

  1. chown -R appuser:webgroup /var/www/appCevap
  2. chmod -R 700 /var/www/appCevap
  3. C
    chown -r appuser:webgroup /var/www/app
  4. D
    chmod -u 700 /var/www/app

Cevap

The administrator must execute `chown -R appuser:webgroup /var/www/app` to set file ownership recursively and `chmod -R 700 /var/www/app` to set file permissions recursively.
The command `chown -R appuser:webgroup /var/www/app` correctly updates the user and group ownership recursively across the directory structure. The command `chmod -R 700 /var/www/app` correctly sets read, write, and execute rights for the owner while revoking all permissions for group and others across all contained files and directories.

Adım Adım Çözüm

1
Change user and group ownership recursively
`chown -R appuser:webgroup /var/www/app` assigns ownership to `appuser` and `webgroup` for all contained items.
The `-R` flag specifies recursive traversal, and the `owner:group` syntax updates both owners simultaneously.
2
Set strict owner-only access permissions recursively
`chmod -R 700 /var/www/app` applies octal mode 700 (`rwx------`) recursively.
Octal 7 grants full read (4), write (2), and execute (1) permissions to the user owner, while 0 grants no permissions to group or others.

Anahtar Kavram

Linux recursive file access control using chown and chmod
Tahmini Süre:1m 30s
Bu soruyu puanla