- Alright, time for the sample exam.
So how does this work?
Well, I'm going to present the questions overview.
You are going to try to finish all of these questions in,
let's say, an hour and a half.
Take your time, because time is not an issue yet.
It's all about the experience.
So, I'm going to read the questions for you.
And what I would advise, is after I read a question,
click pause, work on it, move on to the next question.
So work your way through the exam,
and do it as if it were a real exam.
And once you're done, you can look
at the solutions in all of the following videos.
So here we go.
So, the first question is about working with files.
Use the appropriate command to locate all files
on your system with a size bigger than a hundred megabytes,
and write the result of that command
to the file slash TMP slash bigfiles.
Next, create a hard link in the user root home directory
with the name bigfiles that links
to the file created in the previous step.
Second assignment, it's about users and permissions.
Set defaults for all new users such
that passwords have a maximum validity of 90 days.
And when creating new users, copy an empty file
with the name data to their home directory.
Next assignment is about managing users and permissions.
Create users Anna and Anouk,
and set their secondary group membership to profs.
Create users, Linda and Lisa
and set their secondary group membership to students.
Create a directory, data profs, as well
as data students, and ensure that members
of the group students have full access to
data students and profs has full access to data profs.
Also ensure that new files
in these directories are automatically group owned
by the group owners of the directories.
Users should only be allowed to delete their own files
in these directories,
but Anna should be able to delete all files.
Next assignment is about storage.
Add a secondary disk to server one and
on this disc create an LVM logical volume group
with the name VG exam and a size of two gigabytes.
The volume group should use two physical volumes
that are created as partitions
on the secondary disk that you have added.
In the VG exam volume group,
create a logical volume with the name LV exam.
Format it with the EXT4 file system,
and mount it persistently on slash exam.
Last, copy all files with the size greater than one megabyte
from the slash ETC directory to the new volume,
which is mounted on the directory slash exam.
Next assignment is about scheduling tasks.
Schedule a task that writes a text "good morning"
to the default system logging system every day at 5:00 AM.
And ensure this tasks runs as user Bob.
Create this user if that is necessary.
Then, you are going to protect some files.
So create the file TMP protected file containing the text,
"I am protected", and ensure that this file can be added to,
but not removed, and current contents cannot be changed.
Then, you are going to run some containers.
Start a container that is based on the docker dot IO
library NGINX latest image,
and ensure it meets the following requirements:
The container is started by the root user.
The container main application can be reached
on localhost port 8080.
An environment variable is set as type equals web server.
The container is started as a background process.
And within the container, a directory data is presented.
And all files written to that directory
are mapped to slash route slash data.
Now, you are going to manage some services.
Create a SystemD unit that runs the sleep infinity command.
The unit should be enabled
in multi-user target and run with an adjusted priority
giving it a lower priority than any other running processes.
Then, we are going to do some command line usage.
Create a file that contains a list of all files
on your system that have the set user ID permission set.
Call this file slash route slash SUID
dash files dash base, dot TXT.
Add the file TMP runme, and ensure it has the SUID,
as well as the execute permissions.
Run the appropriate command to create a file
that contains a list of all files
on your system that have the SUID permission set.
Call it slash route slash SUID files,
dash, DDMMYYYY, dot TXT.
Where this last part is, is automatically set
to the date on which this command is run.
Next, generate a list of differences between the two files,
and write the differences found to TMP SUID differences,
followed by the date extension.
And then generate a scheduled job
that will automatically do this once a day.
Alright, next assignment is about storage management.
Add a new disk to your system with the size of 10 gigabytes.
And on this disk create a GPT partition with the size
of two gigabytes, and mount it by UUID on
the directory slash files.
Ensure that this mount is happening automatically,
but only through a SystemD mount unit.
And a mount should not be included in ETC FSTAB.
Next, you are going to work on swap.
Create a swap file with the name slash swapfile,
and ensure it is activated automatically when booting.
Configure the appropriate SYSCTL parameter to
set the system preference for swapping out data
on memory shortage to the value 70.
Then, you are going to set the hostname.
Set the host name of your computer
to examhost dot example dot local.
And ensure that this host name resolves
to your computer's primary IP address.
Now, you are going to write a script.
So, the script should prompt the user to enter a color,
and the name of the color should be stored in a variable.
The script should loop in, in such a way,
that every 10 seconds it'll prompt the message,
"the color is...", whatever on screen.
And ensure that the actual color name is printed.
Start this script in a way that it takes a lower priority
than other processes running on your computer.
Then, let's do some SystemD Journal management.
Configure the SystemD Journal
in such a way that it is stored persistently.
And finally, set up your system such that direct login
by the user root is only allowed on TTY3.
And ensure that this requires your your root user
to be able to log in with a password.
Good luck with all of it.