الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

معمل 7.1RHCSA 10, الفصل 7

Build shared team folders

المستوى
متوسط
30 دقيقة
الأجهزة
server1
الحالة
لم يبدأ

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

الهدف

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

قبل أن تبدأ

  • 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.

المهام

  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.

تحقّق من عملك

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".

تلميحات

اعرض التلميحات

الحل

اعرض الحل
  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

ملاحظاتي

لا توجد ملاحظات بعد.

دروس هذا المعمل

الأوامر في هذا المعمل