- So the first part of the lab
is to ensure that the files created
by user root cannot be accessed by group or others.
And files of ordinary users should be readable
by the group owners.
That's the umask.
And we seen that in the lesson about umask.
Let me just repeat
sudo vim on etc
skel .bashrc
In which I added umask 002.
And as umask 002, that makes that files
created by users are readable
and writeable by the user as well as the group.
Now, if you wanna do so, something similar for user root.
Well I would say just use
sudo vim on /root/.bashrc
And in there you are going to add
umask 007.
I don't like 077 too much.
I like 007 a little bit more.
But if you take the lab exactly as it is
you should do 077 to make it inaccessible
by the group as well.
Right? Let's continue.
And the next thing is to create a directory
is data sales and data account.
sudo mkdir -p
/data/sales
and /data/account
And I know I've demonstrated the data sales
directory already
but I just wanna give you complete commands.
Next, members of the group sales should be able
to read and write in data sales and members
of the group account should be able
to read and write in data account.
Let's read everything because right here
this is C H G R P and permission mode 7 7 something.
No other users should have access
to these directories. That makes a permission mode 770.
And users will only be allowed to delete files
they have created themselves with user.
Anna, our sales manager, should be able to
manage all sales files. That is throwing in some sticky bit.
All right, let me go.
And you know what?
I'm going to open a root shell
in order to do this. Makes it slightly easier.
(keyboard clicks)
I'm using ls -l. And first the permission mode
I'm using chmod. chmod what?
3770 on star
Why a 3?
Because I need sticky bit.
I need set group ID bit as well
because set group ID makes sense
on these shared directories.
ls - l is showing that permissions are set all right.
Next, I need to make sure that we have
chown Anna *
Why is that?
That's because Anna is a sales manager
and Anna should be able to, to delete
all these files in the directories.
And if a user is owner of the directory
then the user is allowed to do maintenance on the directory.
Which means delete files from the directory.
Last C H G R P account on account.
And that will do it. ls - l is showing this.
And this is what we needed to accomplish
in this specific lab.
And you know what?
That's all. Let's continue with the next lesson.