Hands-on lab – creating a shared group directory

For this lab, you'll just put together everything that you've learned in this chapter to create a shared directory for a group. You can do this on either of your virtual machines:

  1. On either virtual machine, create the sales group:
sudo groupadd sales
  1. Create the users mimi, mrgray, and mommy, adding them to the sales group as you create the accounts.

On the CentOS VM, do the following:

sudo useradd -G sales mimi
sudo useradd -G sales mrgray
sudo useradd -G sales mommy

On the Ubuntu VM, do the following:

sudo useradd -m -d /home/mimi -s /bin/bash -G sales mimi
sudo useradd -m -d /home/mrgray -s /bin/bash -G sales mrgray
sudo useradd -m -d /home/mommy -s /bin/bash -G sales mommy
  1. Assign each user a password.
  2. Create the sales directory in the root level of the filesystem. Set proper ownership and permissions, including the SGID and sticky bits:
sudo mkdir /sales
sudo chown nobody:sales /sales
sudo chmod 3770 /sales
ls -ld /sales
  1. Log in as Mimi, and have her create a file:
su - mimi
cd /sales
echo "This file belongs to Mimi." > mimi_file.txt
ls -l
  1. Have Mimi set an ACL on her file, allowing only Mr. Gray to read it. Then, have Mimi log back out:
chmod 600 mimi_file.txt
setfacl -m u:mrgray:r mimi_file.txt
getfacl mimi_file.txt
ls -l
exit
  1. Have Mr. Gray log in to see what he can do with Mimi's file. Then, have Mr. Gray create his own file and log back out:
su - mrgray
cd /sales
cat mimi_file.txt
echo "I want to add something to this file." >>
mimi_file.txt
echo "Mr. Gray will now create his own file." >

mr_gray_file.txt ls -l
exit
  1. Mommy will now log in and try to wreak havoc by snooping in other users' files and by trying to delete them:
su - mommy
cat mimi_file.txt
cat mr_gray_file.txt
rm -f mimi_file.txt
rm -f mr_gray_file.txt
exit
  1. End of lab.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.40.43