1 00:00:06,510 --> 00:00:08,760 - Alright, time for the sample exam. 2 00:00:08,760 --> 00:00:10,020 So how does this work? 3 00:00:10,020 --> 00:00:12,660 Well, I'm going to present the questions overview. 4 00:00:12,660 --> 00:00:15,480 You are going to try to finish all of these questions in, 5 00:00:15,480 --> 00:00:17,250 let's say, an hour and a half. 6 00:00:17,250 --> 00:00:20,430 Take your time, because time is not an issue yet. 7 00:00:20,430 --> 00:00:22,320 It's all about the experience. 8 00:00:22,320 --> 00:00:24,450 So, I'm going to read the questions for you. 9 00:00:24,450 --> 00:00:28,410 And what I would advise, is after I read a question, 10 00:00:28,410 --> 00:00:31,950 click pause, work on it, move on to the next question. 11 00:00:31,950 --> 00:00:33,570 So work your way through the exam, 12 00:00:33,570 --> 00:00:36,060 and do it as if it were a real exam. 13 00:00:36,060 --> 00:00:38,040 And once you're done, you can look 14 00:00:38,040 --> 00:00:40,770 at the solutions in all of the following videos. 15 00:00:40,770 --> 00:00:41,673 So here we go. 16 00:00:42,570 --> 00:00:45,330 So, the first question is about working with files. 17 00:00:45,330 --> 00:00:47,850 Use the appropriate command to locate all files 18 00:00:47,850 --> 00:00:51,270 on your system with a size bigger than a hundred megabytes, 19 00:00:51,270 --> 00:00:53,236 and write the result of that command 20 00:00:53,236 --> 00:00:57,180 to the file slash TMP slash bigfiles. 21 00:00:57,180 --> 00:01:00,780 Next, create a hard link in the user root home directory 22 00:01:00,780 --> 00:01:02,370 with the name bigfiles that links 23 00:01:02,370 --> 00:01:04,420 to the file created in the previous step. 24 00:01:06,480 --> 00:01:09,690 Second assignment, it's about users and permissions. 25 00:01:09,690 --> 00:01:11,760 Set defaults for all new users such 26 00:01:11,760 --> 00:01:15,180 that passwords have a maximum validity of 90 days. 27 00:01:15,180 --> 00:01:17,790 And when creating new users, copy an empty file 28 00:01:17,790 --> 00:01:20,163 with the name data to their home directory. 29 00:01:21,960 --> 00:01:25,143 Next assignment is about managing users and permissions. 30 00:01:26,340 --> 00:01:27,657 Create users Anna and Anouk, 31 00:01:27,657 --> 00:01:30,780 and set their secondary group membership to profs. 32 00:01:30,780 --> 00:01:32,340 Create users, Linda and Lisa 33 00:01:32,340 --> 00:01:35,790 and set their secondary group membership to students. 34 00:01:35,790 --> 00:01:38,190 Create a directory, data profs, as well 35 00:01:38,190 --> 00:01:40,560 as data students, and ensure that members 36 00:01:40,560 --> 00:01:42,630 of the group students have full access to 37 00:01:42,630 --> 00:01:45,963 data students and profs has full access to data profs. 38 00:01:46,980 --> 00:01:48,420 Also ensure that new files 39 00:01:48,420 --> 00:01:50,790 in these directories are automatically group owned 40 00:01:50,790 --> 00:01:52,773 by the group owners of the directories. 41 00:01:53,700 --> 00:01:56,280 Users should only be allowed to delete their own files 42 00:01:56,280 --> 00:01:57,240 in these directories, 43 00:01:57,240 --> 00:02:00,063 but Anna should be able to delete all files. 44 00:02:03,300 --> 00:02:05,850 Next assignment is about storage. 45 00:02:05,850 --> 00:02:08,280 Add a secondary disk to server one and 46 00:02:08,280 --> 00:02:11,700 on this disc create an LVM logical volume group 47 00:02:11,700 --> 00:02:15,600 with the name VG exam and a size of two gigabytes. 48 00:02:15,600 --> 00:02:17,910 The volume group should use two physical volumes 49 00:02:17,910 --> 00:02:19,740 that are created as partitions 50 00:02:19,740 --> 00:02:21,840 on the secondary disk that you have added. 51 00:02:22,740 --> 00:02:24,630 In the VG exam volume group, 52 00:02:24,630 --> 00:02:27,870 create a logical volume with the name LV exam. 53 00:02:27,870 --> 00:02:30,210 Format it with the EXT4 file system, 54 00:02:30,210 --> 00:02:32,763 and mount it persistently on slash exam. 55 00:02:33,840 --> 00:02:37,320 Last, copy all files with the size greater than one megabyte 56 00:02:37,320 --> 00:02:40,260 from the slash ETC directory to the new volume, 57 00:02:40,260 --> 00:02:43,143 which is mounted on the directory slash exam. 58 00:02:44,400 --> 00:02:46,950 Next assignment is about scheduling tasks. 59 00:02:46,950 --> 00:02:50,160 Schedule a task that writes a text "good morning" 60 00:02:50,160 --> 00:02:53,700 to the default system logging system every day at 5:00 AM. 61 00:02:53,700 --> 00:02:56,580 And ensure this tasks runs as user Bob. 62 00:02:56,580 --> 00:02:58,533 Create this user if that is necessary. 63 00:02:59,880 --> 00:03:02,070 Then, you are going to protect some files. 64 00:03:02,070 --> 00:03:05,527 So create the file TMP protected file containing the text, 65 00:03:05,527 --> 00:03:08,580 "I am protected", and ensure that this file can be added to, 66 00:03:08,580 --> 00:03:12,273 but not removed, and current contents cannot be changed. 67 00:03:13,500 --> 00:03:16,170 Then, you are going to run some containers. 68 00:03:16,170 --> 00:03:18,660 Start a container that is based on the docker dot IO 69 00:03:18,660 --> 00:03:20,940 library NGINX latest image, 70 00:03:20,940 --> 00:03:23,760 and ensure it meets the following requirements: 71 00:03:23,760 --> 00:03:26,310 The container is started by the root user. 72 00:03:26,310 --> 00:03:28,350 The container main application can be reached 73 00:03:28,350 --> 00:03:30,930 on localhost port 8080. 74 00:03:30,930 --> 00:03:35,433 An environment variable is set as type equals web server. 75 00:03:36,270 --> 00:03:39,120 The container is started as a background process. 76 00:03:39,120 --> 00:03:42,720 And within the container, a directory data is presented. 77 00:03:42,720 --> 00:03:44,460 And all files written to that directory 78 00:03:44,460 --> 00:03:46,683 are mapped to slash route slash data. 79 00:03:48,180 --> 00:03:50,370 Now, you are going to manage some services. 80 00:03:50,370 --> 00:03:54,510 Create a SystemD unit that runs the sleep infinity command. 81 00:03:54,510 --> 00:03:55,830 The unit should be enabled 82 00:03:55,830 --> 00:03:59,010 in multi-user target and run with an adjusted priority 83 00:03:59,010 --> 00:04:02,223 giving it a lower priority than any other running processes. 84 00:04:03,270 --> 00:04:06,390 Then, we are going to do some command line usage. 85 00:04:06,390 --> 00:04:09,060 Create a file that contains a list of all files 86 00:04:09,060 --> 00:04:13,170 on your system that have the set user ID permission set. 87 00:04:13,170 --> 00:04:16,620 Call this file slash route slash SUID 88 00:04:16,620 --> 00:04:19,488 dash files dash base, dot TXT. 89 00:04:19,488 --> 00:04:23,460 Add the file TMP runme, and ensure it has the SUID, 90 00:04:23,460 --> 00:04:25,210 as well as the execute permissions. 91 00:04:26,280 --> 00:04:28,320 Run the appropriate command to create a file 92 00:04:28,320 --> 00:04:29,970 that contains a list of all files 93 00:04:29,970 --> 00:04:33,058 on your system that have the SUID permission set. 94 00:04:33,058 --> 00:04:36,703 Call it slash route slash SUID files, 95 00:04:36,703 --> 00:04:41,250 dash, DDMMYYYY, dot TXT. 96 00:04:41,250 --> 00:04:44,812 Where this last part is, is automatically set 97 00:04:44,812 --> 00:04:47,433 to the date on which this command is run. 98 00:04:48,750 --> 00:04:51,810 Next, generate a list of differences between the two files, 99 00:04:51,810 --> 00:04:56,730 and write the differences found to TMP SUID differences, 100 00:04:56,730 --> 00:04:58,353 followed by the date extension. 101 00:04:59,190 --> 00:05:00,990 And then generate a scheduled job 102 00:05:00,990 --> 00:05:03,213 that will automatically do this once a day. 103 00:05:05,070 --> 00:05:08,340 Alright, next assignment is about storage management. 104 00:05:08,340 --> 00:05:11,580 Add a new disk to your system with the size of 10 gigabytes. 105 00:05:11,580 --> 00:05:14,490 And on this disk create a GPT partition with the size 106 00:05:14,490 --> 00:05:17,037 of two gigabytes, and mount it by UUID on 107 00:05:17,037 --> 00:05:19,560 the directory slash files. 108 00:05:19,560 --> 00:05:22,110 Ensure that this mount is happening automatically, 109 00:05:22,110 --> 00:05:24,540 but only through a SystemD mount unit. 110 00:05:24,540 --> 00:05:27,183 And a mount should not be included in ETC FSTAB. 111 00:05:29,070 --> 00:05:31,110 Next, you are going to work on swap. 112 00:05:31,110 --> 00:05:33,690 Create a swap file with the name slash swapfile, 113 00:05:33,690 --> 00:05:37,110 and ensure it is activated automatically when booting. 114 00:05:37,110 --> 00:05:39,600 Configure the appropriate SYSCTL parameter to 115 00:05:39,600 --> 00:05:42,270 set the system preference for swapping out data 116 00:05:42,270 --> 00:05:45,483 on memory shortage to the value 70. 117 00:05:47,430 --> 00:05:49,620 Then, you are going to set the hostname. 118 00:05:49,620 --> 00:05:50,940 Set the host name of your computer 119 00:05:50,940 --> 00:05:53,613 to examhost dot example dot local. 120 00:05:54,480 --> 00:05:56,760 And ensure that this host name resolves 121 00:05:56,760 --> 00:05:59,193 to your computer's primary IP address. 122 00:06:01,050 --> 00:06:03,240 Now, you are going to write a script. 123 00:06:03,240 --> 00:06:05,880 So, the script should prompt the user to enter a color, 124 00:06:05,880 --> 00:06:08,940 and the name of the color should be stored in a variable. 125 00:06:08,940 --> 00:06:11,220 The script should loop in, in such a way, 126 00:06:11,220 --> 00:06:13,177 that every 10 seconds it'll prompt the message, 127 00:06:13,177 --> 00:06:15,637 "the color is...", whatever on screen. 128 00:06:15,637 --> 00:06:20,040 And ensure that the actual color name is printed. 129 00:06:20,040 --> 00:06:23,220 Start this script in a way that it takes a lower priority 130 00:06:23,220 --> 00:06:25,520 than other processes running on your computer. 131 00:06:27,030 --> 00:06:30,090 Then, let's do some SystemD Journal management. 132 00:06:30,090 --> 00:06:31,620 Configure the SystemD Journal 133 00:06:31,620 --> 00:06:34,650 in such a way that it is stored persistently. 134 00:06:34,650 --> 00:06:38,400 And finally, set up your system such that direct login 135 00:06:38,400 --> 00:06:41,850 by the user root is only allowed on TTY3. 136 00:06:41,850 --> 00:06:44,400 And ensure that this requires your your root user 137 00:06:44,400 --> 00:06:46,830 to be able to log in with a password. 138 00:06:46,830 --> 00:06:48,303 Good luck with all of it.