Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Lab 7.1RHCSA 10, Hoofdstuk 7

Build shared team folders

Niveau
Gemiddeld
30 min
Machines
server1
Status
Nog niet begonnen

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Doel

Create two team folders where members work together, new files get the team group, and nobody can delete the files of others.

Voordat je begint

  • Work on server1 as root. You need the users and groups from lab 6.1 (anna, bob in sales; bob in account). If they do not exist, create them.

Taken

  1. Create the folders /data/sales and /data/account.
  2. /data/sales belongs to the group sales, /data/account to the group account. The owner of both is root.
  3. Group members may read and write in their folder. Others may not even list the content.
  4. New files in each folder must get the group of the folder.
  5. Users may delete only their own files in these folders.
  6. As anna, create /data/sales/anna.txt. As bob, try to delete it (this must fail) and create /data/sales/bob.txt.

Controleer je werk

ls -ld /data/sales /data/account
ls -l /data/sales
su - bob -c 'rm -f /data/sales/anna.txt'
su - carol -c 'ls /data/sales'
  • Both folders show drwxrws--T with the right group.
  • anna.txt and bob.txt have the group sales.
  • bob gets "Operation not permitted"; carol gets "Permission denied".

Hints

Toon de hints

Oplossing

Toon de oplossing
  1. Create the folders.
    mkdir -p /data/sales /data/account
  2. Set the groups.
    chgrp sales /data/sales
    chgrp account /data/account
  3. Set rights, SGID and sticky in one go (tasks 3, 4 and 5).
    chmod 3770 /data/sales /data/account
  4. Test as the users.
    su - anna -c 'touch /data/sales/anna.txt'
    su - bob -c 'rm -f /data/sales/anna.txt'
    rm: cannot remove '/data/sales/anna.txt': Operation not permitted
    su - bob -c 'touch /data/sales/bob.txt'
    ls -l /data/sales

Mijn notities

Nog geen notities.

Lessen voor dit lab

Commando's in dit lab