├── .github
└── workflows
│ └── ci.yml
├── README.md
├── docs
├── cgroups.md
├── devices.md
├── favicon.png
├── files.md
├── index.md
├── namespaces.md
├── network.md
├── processes.md
├── security.md
├── shell.md
├── signals.md
├── syscalls.md
└── system.md
├── mkdocs.yml
└── overrides
└── main.html
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: ci
2 | on:
3 | push:
4 | branches:
5 | - main
6 | jobs:
7 | deploy:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v2
11 | - uses: actions/setup-python@v2
12 | with:
13 | python-version: 3.x
14 | - run: pip install mkdocs-material
15 | - run: mkdocs gh-deploy --force
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Questions to test your Linux knowledge.
2 |
3 | ## Table of Contents:
4 |
5 | 1. [cgroups](https://katademy.github.io/linux-faq/cgrou[s])
6 | 1. [devices](https://katademy.github.io/linux-faq/devices)
7 | 1. [files](https://katademy.github.io/linux-faq/files)
8 | 1. [namespaces](https://katademy.github.io/linux-faq/namespaces)
9 | 1. [network](https://katademy.github.io/linux-faq/network)
10 | 1. [processes](https://katademy.github.io/linux-faq/processes)
11 | 1. [security](https://katademy.github.io/linux-faq/security)
12 | 1. [shell](https://katademy.github.io/linux-faq/shell)
13 | 1. [signals](https://katademy.github.io/linux-faq/signals)
14 | 1. [syscalls](https://katademy.github.io/linux-faq/syscalls)
15 | 1. [system](https://katademy.github.io/linux-faq/system)
16 |
17 | #### Like this project?
18 |
19 | * [Leave a Star](https://github.com/katademy/linux-faq/stargazers)
20 | * Follow [@katademy](https://twitter.com/katademy) on Twitter
21 | * Donate via [PayPal](https://paypal.me/icelynjennings) or [Patreon](https://patreon.com/icelynjennings)
22 |
--------------------------------------------------------------------------------
/docs/cgroups.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | _____ of memory cgroups trigger an Out-of-Memory killer inside them. A process will get killed when it goes above them.
4 |
5 | Hard limits
6 |
7 |
8 |
9 |
10 | Can cgroups limit I/O devices/operations usable by a process? _____
11 |
12 | Yes
13 |
14 |
15 |
16 |
17 | Can cgroups limit network bandwidth usable by a process? _____
18 |
19 | Yes
20 |
21 |
22 |
23 |
24 | The file /proc/[pid]/cgroup contains the process's _____
25 |
26 | enclosing control group
27 |
28 |
29 |
30 |
31 | _____ allow you to set resource limits on processes and their children.
32 |
33 | cgroups
34 |
35 |
36 |
37 |
38 | _____ cgroup limits are not enforced.
39 |
40 | soft
41 |
42 |
43 |
44 |
45 | The _____ (crowd control) cgroup allows to freeze/thaw a group of processes, much like it is done by SIGSTOP signals. Unlike signals however, it CANNOT be detected by the processes. This is useful for cluster batch scheduling and process migration. Doesn't impede ptrace/debugging.
46 |
47 | freezer
48 |
49 |
50 |
51 |
52 | Can cgroups limit memory usable by a process? _____
53 |
54 | Yes
55 |
56 |
57 |
58 |
59 | Each cgroup can have its own _____ or hard limits
60 |
61 | soft
62 |
63 |
64 |
65 |
66 | The _____ cgroup controls what a group can do what on device nodes (read/write/mknod permissions etc). You can do it on /dev/net/tun, /dev/fuse, /dev/kvm, /dev/dri so you can have network interface manipulation, filesystems in user space, VMs and GPUs inside containers. Example: allow /dev/xxxx deny everything else
67 |
68 | device
69 |
70 |
71 |
72 |
73 | "The _____ cgroup keeps track of pages used by each group. Each page is """"charged"""" to a group and can be shared across groups. file (read/write/mmap from block devices) anonymous (stack, heap, anonymous mmap) active (recently accessed) inactive (candidate for eviction)"""
74 |
75 | memory
76 |
77 |
78 |
79 |
80 | _____ allow limiting the amount of resources usable by a process.
81 |
82 | cgroups
83 |
84 |
85 |
86 |
87 | When processes inside a Linux system are running out of memory, lower priority processes might be randomly killed by the kernel to free memory up. A _____ cgroup ensures that whenever a process inside it is running out of memory, only the processes inside that cgroup will be up for deletion in such a situation - never the ones outside it.
88 |
89 | memory
90 |
91 |
92 |
93 |
94 | Can a CPU cgroup set CPU weights? _____
95 |
96 | Yes
97 |
98 |
99 |
100 |
101 | _____ cgroups pin groups of processes to a specific cpu or reserve cpus to specific apps, preventing processes from switching around CPUs.
102 |
103 | cpuset
104 |
105 |
106 |
107 |
108 | A _____ cgroup keeps track of user system cpu time, and usage per cpu.
109 |
110 | CPU
111 |
112 |
113 |
114 |
115 | The file _____ contains the process's enclosing control group
116 |
117 | /proc/[pid]/cgroup
118 |
119 |
120 |
121 |
122 | Do cgroups limit the resources a process can use (in quantity)? _____
123 |
124 | Yes
125 |
126 |
127 |
128 |
129 | The _____ cgroup keeps track of IO for each group. You can set throttle limits and relative weights for each group.
130 |
131 | blkio
132 |
133 |
134 |
135 |
136 | _____ cgroups automatically set traffic class or priority for traffic generated by processes in the group. (only works for egress traffic) net_cls will assign traffic to a class (which then has to be matched with iptables)
137 |
138 | net_cls and net_prio
139 |
140 |
141 |
142 |
143 | "When a process needs to perform a root-account specific action, but you don't want it to have root account permissions, _____ can be set in order to """"break down"""" the root account into multiple fine-grained permissions."""
144 |
145 | capabilities Nevertheless, the CAP_SYS_ADMIN capability cannot be disabled
146 |
147 |
148 |
149 |
150 | Linux Containers are usually a combination of _____
151 |
152 | cgroups, namespaces, SELinux, AppArmor
153 |
154 |
155 |
156 |
157 | The command _____ can be used to move a process to a cgroup
158 |
159 | echo $PID > /sys/fs/cgroup/.../tasks
160 |
161 |
162 |
163 |
164 | The command echo $PID > /sys/fs/cgroup/.../tasks _____
165 |
166 | can be used to move a process to a cgroup
167 |
168 |
169 |
170 |
171 | Each cgroup can have its own soft or _____ limits
172 |
173 | hard
174 |
175 |
176 |
177 |
178 | Can you make a cgroup limit any kind of memory? (e.g. physical, kernel, total memory...) _____
179 |
180 | Yes
181 |
182 |
183 |
184 |
185 | Can cgroups limit CPU time usable by a process? _____
186 |
187 | Yes
188 |
189 |
190 |
191 |
192 | Each cgroup can have its own soft or hard _____
193 |
194 | limits
195 |
196 |
197 |
198 |
199 | Can a CPU cgroup set CPU limits? _____
200 |
201 | No
202 |
203 |
204 |
205 |
206 | PID 1 is placed at the root of each cgroup. Are its children created inside the parent's groups? _____
207 |
208 | Yes
209 |
210 |
211 |
--------------------------------------------------------------------------------
/docs/devices.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | The command free _____
4 |
5 | displays memory usage
6 |
7 |
8 |
9 |
10 | The command _____ displays memory usage
11 |
12 | free
13 |
14 |
15 |
16 |
17 | The directory /media predominantly contains _____
18 |
19 | mounted external devices such as USB drives
20 |
21 |
22 |
23 |
24 | The mount type _____ is one-directional.
25 |
26 | slave
27 |
28 |
29 |
30 |
31 | The /dev directory predominantly stores _____
32 |
33 | device files
34 |
35 |
36 |
37 |
38 | The mount type _____ is private and cannot be replicated.
39 |
40 | unbindable
41 |
42 |
43 |
44 |
45 | The command vmstat _____
46 |
47 | reports virtual memory statistics
48 |
49 |
50 |
51 |
52 | The mount type _____ is not shown unless mounted.
53 |
54 | private
55 |
56 |
57 |
58 |
59 | The command umount _____
60 |
61 | unmounts a specified device
62 |
63 |
64 |
65 |
66 | The command _____ unmounts a specified device
67 |
68 | umount
69 |
70 |
71 |
72 |
73 | The command _____ reports virtual memory statistics
74 |
75 | vmstat
76 |
77 |
78 |
--------------------------------------------------------------------------------
/docs/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/katademy/linux/57f9f7aad2f4dd9d69d593cb820344255521e8a5/docs/favicon.png
--------------------------------------------------------------------------------
/docs/files.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | The command _____ displays disk usage and limits
4 |
5 | quota
6 |
7 |
8 |
9 |
10 | The command _____ lists text files that only have 1 character in their name
11 |
12 | ls ?.txt
13 |
14 |
15 |
16 |
17 | The command touch used on an existing file will _____
18 |
19 | change its timestamp to the latest date and time
20 |
21 |
22 |
23 |
24 | "The command _____ lists all files whose names begin with the letter """"a"""", and their second letter is either """"b"""" or """"c"
25 |
26 | ls a[bc]
27 |
28 |
29 |
30 |
31 | The command _____ updates a file's timestamp if it exists, and does nothing if it doesn't exist
32 |
33 | touch -c
34 |
35 |
36 |
37 |
38 | The command touch -c _____
39 |
40 | updates a file's timestamp if it exists, and does nothing if it doesn't exist
41 |
42 |
43 |
44 |
45 | The command _____ changes file attributes
46 |
47 | chattr
48 |
49 |
50 |
51 |
52 | The command cut -c2 _____
53 |
54 | would print the second column in a text file
55 |
56 |
57 |
58 |
59 | The command file _____
60 |
61 | can determine a file's type
62 |
63 |
64 |
65 |
66 | The command _____ finds directories within the current directory
67 |
68 | find . -type d
69 |
70 |
71 |
72 |
73 | You can't make hard links across filesystem boundaries because their _____ might be identical.
74 |
75 | inodes
76 |
77 |
78 |
79 |
80 | An alias file for an existing file with identical inode is called a _____
81 |
82 | hard link
83 |
84 |
85 |
86 |
87 | A file _____ indicates an I/O resource such as a file, pipe or network socket.
88 |
89 | descriptor
90 |
91 |
92 |
93 |
94 | The command _____ lists the contents of a directory
95 |
96 | ls
97 |
98 |
99 |
100 |
101 | The command _____ can mount a file system
102 |
103 | mount
104 |
105 |
106 |
107 |
108 | The command _____ can search files for lines that match a pattern
109 |
110 | grep
111 |
112 |
113 |
114 |
115 | The command _____ searches files for lines that match a pattern
116 |
117 | fgrep
118 |
119 |
120 |
121 |
122 | The command mount _____
123 |
124 | can mount a file system
125 |
126 |
127 |
128 |
129 | The command _____ continously prints newly added lines of a file
130 |
131 | tail -F
132 |
133 |
134 |
135 |
136 | The command cat _____
137 |
138 | displays a file's contents
139 |
140 |
141 |
142 |
143 | The command _____ searches for a program in the directories listed in the user's PATH environment variable
144 |
145 | which
146 |
147 |
148 |
149 |
150 | The command ls -R _____
151 |
152 | lists a folder's subdirectories
153 |
154 |
155 |
156 |
157 | The directory /bin contains _____
158 |
159 | boot binaries in single user mode
160 |
161 |
162 |
163 |
164 | The command fdisk _____
165 |
166 | manipulates partition tables
167 |
168 |
169 |
170 |
171 | The _____ file lists filesystems and partitions mounted at boot time.
172 |
173 | /etc/fstab
174 |
175 |
176 |
177 |
178 | The command rcp _____
179 |
180 | copies files between two machines.
181 |
182 |
183 |
184 |
185 | When RAM runs out, _____ is used.
186 |
187 | swap space
188 |
189 |
190 |
191 |
192 | The command _____ original.txt copy.txt copies a file
193 |
194 | cp
195 |
196 |
197 |
198 |
199 | The command _____ searches for a program
200 |
201 | whereis
202 |
203 |
204 |
205 |
206 | The command rm _____
207 |
208 | removes files
209 |
210 |
211 |
212 |
213 | The command fgrep _____
214 |
215 | searches files for lines that match a pattern
216 |
217 |
218 |
219 |
220 | The command find . -type f _____
221 |
222 | finds files within the current directory
223 |
224 |
225 |
226 |
227 | The command fsck _____
228 |
229 | checks and repairs filesystem consistency
230 |
231 |
232 |
233 |
234 | /usr/bin stores _____
235 |
236 | executable programs
237 |
238 |
239 |
240 |
241 | The command ls -al _____
242 |
243 | displays the long list of files inside folder, including hidden files
244 |
245 |
246 |
247 |
248 | The command _____ displays the differences between two files
249 |
250 | diff
251 |
252 |
253 |
254 |
255 | The command _____ displays a file's contents
256 |
257 | cat
258 |
259 |
260 |
261 |
262 | The command tar -xf _____
263 |
264 | extracts a tar file
265 |
266 |
267 |
268 |
269 | The command _____ sets the default permission of new files
270 |
271 | umask
272 |
273 |
274 |
275 |
276 | The command _____ runs the commands from a file
277 |
278 | source
279 |
280 |
281 |
282 |
283 | The command _____ changes the current working directory
284 |
285 | cd
286 |
287 |
288 |
289 |
290 | The command _____ manipulates partition tables
291 |
292 | fdisk
293 |
294 |
295 |
296 |
297 | The command du _____
298 |
299 | estimates space usage for each file
300 |
301 |
302 |
303 |
304 | The command diff _____
305 |
306 | displays the differences between two files
307 |
308 |
309 |
310 |
311 | The command _____ scans a file system for disk usage
312 |
313 | quotactl
314 |
315 |
316 |
317 |
318 | The command source _____
319 |
320 | runs the commands from a file
321 |
322 |
323 |
324 |
325 | The command pwd _____
326 |
327 | prints the present working directory
328 |
329 |
330 |
331 |
332 | The three first file descriptors are: _____ 1 stdout 2 stderr
333 |
334 | 0 stdin
335 |
336 |
337 |
338 |
339 | The command which _____ in the directories listed in the user's PATH environment variable
340 |
341 | searches for a program
342 |
343 |
344 |
345 |
346 | The command split _____
347 |
348 | splits a file into pieces of specified size
349 |
350 |
351 |
352 |
353 | The command _____ creates a symbolic link to a file
354 |
355 | ln
356 |
357 |
358 |
359 |
360 | Does each file have its own inode? _____
361 |
362 | Yes
363 |
364 |
365 |
366 |
367 | The command _____ can divide a file into several parts
368 |
369 | cut
370 |
371 |
372 |
373 |
374 | The command _____ sets disk quotas
375 |
376 | quotacheck
377 |
378 |
379 |
380 |
381 | The command _____ estimates space usage for each file
382 |
383 | du
384 |
385 |
386 |
387 |
388 | The command _____ displays free disk space
389 |
390 | df
391 |
392 |
393 |
394 |
395 | The command _____ displays the long list of files inside folder, including hidden files
396 |
397 | ls -al
398 |
399 |
400 |
401 |
402 | "The command _____ lists all text files whose names start with an """"A"
403 |
404 | ls [A]*.txt
405 |
406 |
407 |
408 |
409 | The command _____ can search for files that meet specified criteria
410 |
411 | find
412 |
413 |
414 |
415 |
416 | The command _____ merges two files interactively
417 |
418 | sdiff
419 |
420 |
421 |
422 |
423 | The directory _____ contains boot binaries in single user mode
424 |
425 | /bin
426 |
427 |
428 |
429 |
430 | Does a file's inode store its access, change and deletion timestamps? _____
431 |
432 | Yes
433 |
434 |
435 |
436 |
437 | The command tee _____
438 |
439 | can redirect output towards multiple files
440 |
441 |
442 |
443 |
444 | The command which searches for a program in _____
445 |
446 | the directories listed in the user's PATH environment variable
447 |
448 |
449 |
450 |
451 | The command ls _____
452 |
453 | lists the contents of a directory
454 |
455 |
456 |
457 |
458 | The command find . -type d _____
459 |
460 | finds directories within the current directory
461 |
462 |
463 |
464 |
465 | The command sort < unsorted.txt _____
466 |
467 | pipes an unsorted.txt file into the sort command
468 |
469 |
470 |
471 |
472 | "The command ls [A]*.txt _____"
473 |
474 | lists all text files whose names start with an """"A
475 |
476 |
477 |
478 |
479 | The command ln _____
480 |
481 | creates a symbolic link to a file
482 |
483 |
484 |
485 |
486 | Does a file's inode store the file's creation timestamp? _____
487 |
488 | No
489 |
490 |
491 |
492 |
493 | The command head -1 file.txt _____
494 |
495 | outputs the first line of a file
496 |
497 |
498 |
499 |
500 | Does a file's inode store its file type? _____
501 |
502 | Yes
503 |
504 |
505 |
506 |
507 | The command _____ finds files within the current directory
508 |
509 | find . -type f
510 |
511 |
512 |
513 |
514 | The command _____ can create a hard link
515 |
516 | ln
517 |
518 |
519 |
520 |
521 | The command sort _____
522 |
523 | sorts contents of a file
524 |
525 |
526 |
527 |
528 | The directories /lib and /lib64 predominantly store _____
529 |
530 | Program code libraries
531 |
532 |
533 |
534 |
535 | /sbin and /usr/sbin directories contain _____
536 |
537 | system administration binaries (FDisk, FSCH, ifconfig, init, makefs, shutdown, halt)
538 |
539 |
540 |
541 |
542 | The command umask _____
543 |
544 | sets the default permission of new files
545 |
546 |
547 |
548 |
549 | The three first file descriptors are: 0 stdin 1 stdout _____
550 |
551 | 2 stderr
552 |
553 |
554 |
555 |
556 | The command tar -cf _____
557 |
558 | creates a tar file
559 |
560 |
561 |
562 |
563 | An _____ is a data structure that stores relevant information about a file.
564 |
565 | inode
566 |
567 |
568 |
569 |
570 | The command _____ outputs the last line of a file
571 |
572 | tail -1 file.txt
573 |
574 |
575 |
576 |
577 | The three first file descriptors are: 0 stdin _____ 2 stderr
578 |
579 | 1 stdout
580 |
581 |
582 |
583 |
584 | The command ls ?.txt _____
585 |
586 | lists text files that only have 1 character in their name
587 |
588 |
589 |
590 |
591 | The command _____ sorts contents of a file
592 |
593 | sort
594 |
595 |
596 |
597 |
598 | The command _____ makes a secure, remote file copy.
599 |
600 | scp
601 |
602 |
603 |
604 |
605 | The command _____ used on an existing file will change its timestamp to the latest date and time
606 |
607 | touch
608 |
609 |
610 |
611 |
612 | The command chattr _____
613 |
614 | changes file attributes
615 |
616 |
617 |
618 |
619 | "The command find . -name ""abc*"" _____"
620 |
621 | finds files that have the partial string ""abc"" in the name
622 |
623 |
624 |
625 |
626 | The command quotacheck _____
627 |
628 | sets disk quotas
629 |
630 |
631 |
632 |
633 | The command _____ helps recover data, especially after using dd
634 |
635 | ddrescue
636 |
637 |
638 |
639 |
640 | The command _____ can convert a full pathname to just a path
641 |
642 | dirname
643 |
644 |
645 |
646 |
647 | The command _____ can display when a file was last accessed
648 |
649 | stat
650 |
651 |
652 |
653 |
654 | Does a file's inode store its size? _____
655 |
656 | Yes
657 |
658 |
659 |
660 |
661 | The command mv _____
662 |
663 | can move or rename files and directories
664 |
665 |
666 |
667 |
668 | Does a file's inode store its ACLs? _____
669 |
670 | Yes
671 |
672 |
673 |
674 |
675 | "The command ls a[bc] _____"
676 |
677 | lists all files whose names begin with the letter """"a"""", and their second letter is either """"b"""" or """"c
678 |
679 |
680 |
681 |
682 | The command _____ would print the second column in a text file
683 |
684 | cut -c2
685 |
686 |
687 |
688 |
689 | The command quota _____
690 |
691 | displays disk usage and limits
692 |
693 |
694 |
695 |
696 | The directory /etc predominantly stores _____
697 |
698 | configuration files
699 |
700 |
701 |
702 |
703 | The directory /tmp predominantly stores _____
704 |
705 | Temporary files created by the system
706 |
707 |
708 |
709 |
710 | The command df _____
711 |
712 | displays free disk space
713 |
714 |
715 |
716 |
717 | The command _____ creates a tar file
718 |
719 | tar -cf
720 |
721 |
722 |
723 |
724 | The command wc _____
725 |
726 | gets a file's word count
727 |
728 |
729 |
730 |
731 | The command mkdir _____
732 |
733 | creates new folders
734 |
735 |
736 |
737 |
738 | The command _____ copies files between two machines.
739 |
740 | rcp
741 |
742 |
743 |
744 |
745 | The command _____ splits a file into pieces of specified size
746 |
747 | split
748 |
749 |
750 |
751 |
752 | _____ directories contain system administration binaries (FDisk, FSCH, ifconfig, init, makefs, shutdown, halt)
753 |
754 | /sbin and /usr/sbin
755 |
756 |
757 |
758 |
759 | The target path of a symlink is stored in the file's _____
760 |
761 | inode
762 |
763 |
764 |
765 |
766 | The command _____ lists a folder's subdirectories
767 |
768 | ls -R
769 |
770 |
771 |
772 |
773 | The command _____ removes files
774 |
775 | rm
776 |
777 |
778 |
779 |
780 | _____ stores executable programs
781 |
782 | /usr/bin
783 |
784 |
785 |
786 |
787 | "The command _____ finds files that have the partial string ""abc"" in the name"
788 |
789 | find . -name ""abc*""
790 |
791 |
792 |
793 |
794 | The command find _____
795 |
796 | can search for files that meet specified criteria
797 |
798 |
799 |
800 |
801 | The command _____ can move or rename files and directories
802 |
803 | mv
804 |
805 |
806 |
807 |
808 | The directory /usr predominantly stores _____
809 |
810 | Application files
811 |
812 |
813 |
814 |
815 | The command cp _____
816 |
817 | original.txt copy.txt copies a file
818 |
819 |
820 |
821 |
822 | The command sdiff _____
823 |
824 | merges two files interactively
825 |
826 |
827 |
828 |
829 | The command _____ can determine a file's type
830 |
831 | file
832 |
833 |
834 |
835 |
836 | The command ls -l _____
837 |
838 | lists folders alphabetically
839 |
840 |
841 |
842 |
843 | The command _____ extracts a tar file
844 |
845 | tar -xf
846 |
847 |
848 |
849 |
850 | The command _____ creates new folders
851 |
852 | mkdir
853 |
854 |
855 |
856 |
857 | The command scp _____
858 |
859 | makes a secure, remote file copy.
860 |
861 |
862 |
863 |
864 | The command cd _____
865 |
866 | changes the current working directory
867 |
868 |
869 |
870 |
871 | Does a file's inode store its special attributes? _____
872 |
873 | Yes
874 |
875 |
876 |
877 |
878 | The command whereis _____
879 |
880 | searches for a program
881 |
882 |
883 |
884 |
885 | The command link _____
886 |
887 | creates a link to a file
888 |
889 |
890 |
891 |
892 | The command grep _____
893 |
894 | can search files for lines that match a pattern
895 |
896 |
897 |
898 |
899 | Does every directory have an inode? _____
900 |
901 | Yes
902 |
903 |
904 |
905 |
906 | The command _____ prints the present working directory
907 |
908 | pwd
909 |
910 |
911 |
912 |
913 | The command _____ outputs the first line of a file
914 |
915 | head -1 file.txt
916 |
917 |
918 |
919 |
920 | The command _____ lists folders alphabetically
921 |
922 | ls -l
923 |
924 |
925 |
926 |
927 | The command _____ creates a link to a file
928 |
929 | link
930 |
931 |
932 |
933 |
934 | The command tail -1 file.txt _____
935 |
936 | outputs the last line of a file
937 |
938 |
939 |
940 |
941 | Does a file's inode store its owner, group and permission information? _____
942 |
943 | Yes
944 |
945 |
946 |
947 |
948 | The command ls -l _____
949 |
950 | displays the long list of a folder
951 |
952 |
953 |
954 |
955 | The command cut _____
956 |
957 | can divide a file into several parts
958 |
959 |
960 |
961 |
962 | The command _____ can redirect output towards multiple files
963 |
964 | tee
965 |
966 |
967 |
968 |
969 | The command ddrescue _____
970 |
971 | helps recover data, especially after using dd
972 |
973 |
974 |
975 |
976 | The command _____ displays the long list of a folder
977 |
978 | ls -l
979 |
980 |
981 |
982 |
983 | Metadata about the filesystem (Type, Size, Mounts, Status) is called the _____
984 |
985 | Superblock
986 |
987 |
988 |
989 |
990 | The command quotactl _____
991 |
992 | scans a file system for disk usage
993 |
994 |
995 |
996 |
997 | The command _____ checks and repairs filesystem consistency
998 |
999 | fsck
1000 |
1001 |
1002 |
1003 |
1004 | The command _____ lists files in use by processes
1005 |
1006 | lsof
1007 |
1008 |
1009 |
1010 |
1011 | The command lsof _____
1012 |
1013 | lists files in use by processes
1014 |
1015 |
1016 |
1017 |
1018 | The command _____ pipes an unsorted.txt file into the sort command
1019 |
1020 | sort < unsorted.txt
1021 |
1022 |
1023 |
1024 |
1025 | The command tail -F _____
1026 |
1027 | continously prints newly added lines of a file
1028 |
1029 |
1030 |
1031 |
1032 | Does a file's inode store the number of links existing to the file? _____
1033 |
1034 | Yes
1035 |
1036 |
1037 |
1038 |
1039 | The command dirname _____
1040 |
1041 | can convert a full pathname to just a path
1042 |
1043 |
1044 |
1045 |
1046 | The command _____ gets a file's word count
1047 |
1048 | wc
1049 |
1050 |
1051 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # linux-faq
2 |
3 | Questions to test your Linux knowledge.
4 |
5 | ## Table of Contents:
6 |
7 | 1. [cgroups](https://katademy.github.io/linux-faq/cgrou[s])
8 | 1. [devices](https://katademy.github.io/linux-faq/devices)
9 | 1. [files](https://katademy.github.io/linux-faq/files)
10 | 1. [namespaces](https://katademy.github.io/linux-faq/namespaces)
11 | 1. [network](https://katademy.github.io/linux-faq/network)
12 | 1. [processes](https://katademy.github.io/linux-faq/processes)
13 | 1. [security](https://katademy.github.io/linux-faq/security)
14 | 1. [shell](https://katademy.github.io/linux-faq/shell)
15 | 1. [signals](https://katademy.github.io/linux-faq/signals)
16 | 1. [syscalls](https://katademy.github.io/linux-faq/syscalls)
17 | 1. [system](https://katademy.github.io/linux-faq/system)
18 |
19 | #### Like this project?
20 |
21 | * [Leave a Star](https://github.com/katademy/linux-faq/stargazers)
22 | * Follow [@katademy](https://twitter.com/katademy) on Twitter
23 | * Donate via [PayPal](https://paypal.me/icelynjennings) or [Patreon](https://patreon.com/icelynjennings)
24 |
--------------------------------------------------------------------------------
/docs/namespaces.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Do namespaces provide processes with their own view of the system? _____
4 |
5 | Yes
6 |
7 |
8 |
9 |
10 | Can namespaces isolate users per process? _____
11 |
12 | Yes
13 |
14 |
15 |
16 |
17 | The available namespaces in Linux are, pid, net, _____, uts, ipc, user, time, cgroup
18 |
19 | mnt
20 |
21 |
22 |
23 |
24 | Can namespaces isolate networking per process? _____
25 |
26 | Yes
27 |
28 |
29 |
30 |
31 | The available namespaces in Linux are, pid, net, mnt, uts, _____, user, time, cgroup
32 |
33 | ipc
34 |
35 |
36 |
37 |
38 | Processes within the _____ namespace can only see the other processes within it.
39 |
40 | PID
41 |
42 |
43 |
44 |
45 | The available namespaces in Linux are, pid, net, mnt, uts, ipc, user, time, _____
46 |
47 | cgroup
48 |
49 |
50 |
51 |
52 | Can network namespaces communicate with each other via a bridge network? _____
53 |
54 | Yes
55 |
56 |
57 |
58 |
59 | Does each PID namespace have its own numbering? _____
60 |
61 | Yes
62 |
63 |
64 |
65 |
66 | The PID 1 namespace is removed from a PID namespace. What happens? _____
67 |
68 | The PID namespace is destroyed
69 |
70 |
71 |
72 |
73 | Using _____ namespaces, you can improve security by giving a unique /tmp or /proc directories to every user.
74 |
75 | mnt
76 |
77 |
78 |
79 |
80 | Can namespaces isolate UTS per process? _____
81 |
82 | Yes
83 |
84 |
85 |
86 |
87 | The available namespaces in Linux are, pid, _____, mnt, uts, ipc, user, time, cgroup
88 |
89 | net
90 |
91 |
92 |
93 |
94 | Can PID namespaces be nested? (namespace within namespace within namespace...) _____
95 |
96 | Yes
97 |
98 |
99 |
100 |
101 | Namespaces are created with the _____ syscall.
102 |
103 | clone()
104 |
105 |
106 |
107 |
108 | A newly made process inherits its namespaces from the _____ process.
109 |
110 | parent
111 |
112 |
113 |
114 |
115 | The available namespaces in Linux are, pid, net, mnt, uts, ipc, _____, time, cgroup
116 |
117 | user
118 |
119 |
120 |
121 |
122 | The available namespaces in Linux are, _____, net, mnt, uts, ipc, user, time, cgroup
123 |
124 | pid
125 |
126 |
127 |
128 |
129 | Can namespaces isolate Inter-Process Communication per process? _____
130 |
131 | Yes
132 |
133 |
134 |
135 |
136 | You can specify the mounted filesystems/devices visible to a process inside a _____ namespace.
137 |
138 | mount namespace
139 |
140 |
141 |
142 |
143 | Can process namespaces be used to isolate processes? _____
144 |
145 | Yes
146 |
147 |
148 |
149 |
150 | An mnt namespace's mounts be _____ or shared
151 |
152 | private
153 |
154 |
155 |
156 |
157 | Can namespaces isolate mounts per process? _____
158 |
159 | Yes
160 |
161 |
162 |
163 |
164 | Can namespaces isolate drives and devices per process? _____
165 |
166 | Yes
167 |
168 |
169 |
170 |
171 | ______ allow processes to use identically named resources and isolate them.
172 |
173 | namespaces
174 |
175 |
176 |
177 |
178 | The /proc/[pid]/ns/ directory contains the process's _____
179 |
180 | links to namespaces used by the process
181 |
182 |
183 |
184 |
185 | Using the _____ namespaces, processes can be given their own root filesystem (conceptually close to chroot)
186 |
187 | mnt
188 |
189 |
190 |
191 |
192 | How many namespaces of can a process simultaneously be in? _____
193 |
194 | One of each type
195 |
196 |
197 |
198 |
199 | "When PID namespaces are nested inside one another, a process inside one has as many _____ as the namespace levels it is nested in. This is how features like """"docker in docker"""" can be implemented."""
200 |
201 | PIDs
202 |
203 |
204 |
205 |
206 | "Network namespaces can use Virtual Ethernet (veth) pairs to communicate. This involves creating two _____ acting as a """"cross-over cable"""" between them."""
207 |
208 | virtual network interfaces
209 |
210 |
211 |
212 |
213 | Can namespaces isolate hostnames per process? _____
214 |
215 | Yes
216 |
217 |
218 |
219 |
220 | The available namespaces in Linux are, pid, net, mnt, uts, ipc, user, _____, cgroup
221 |
222 | time
223 |
224 |
225 |
226 |
227 | The command setns _____
228 |
229 | adds a process to an existing namespace
230 |
231 |
232 |
233 |
234 | The available namespaces in Linux are, pid, net, mnt, _____, ipc, user, time, cgroup
235 |
236 | uts
237 |
238 |
239 |
240 |
241 | Can namespaces isolate PIDs per process? _____
242 |
243 | Yes
244 |
245 |
246 |
247 |
248 | The command nsenter _____
249 |
250 | enters a Linux namespace
251 |
252 |
253 |
254 |
255 | The _____ namespace allows processes to have their own semaphores, message queues and shared memory, without risk of conflict with other processes.
256 |
257 | IPC
258 |
259 |
260 |
261 |
262 | Can namespaces isolate resources per one or more processes? _____
263 |
264 | Yes
265 |
266 |
267 |
268 |
269 | The _____ namespace allows you to map the UID/GID of processes. Even though you might be a privileged user with UID 0 in a container, you will just be user xxxxx on the host.
270 |
271 | user
272 |
273 |
274 |
275 |
276 | An mnt namespace's mounts be private or _____
277 |
278 | shared
279 |
280 |
281 |
282 |
283 | The command ip link set dev eth0 netns ns0 _____
284 |
285 | moves a network interface eth0 to namespace ns0
286 |
287 |
288 |
289 |
290 | The last process inside a namespace dies. What happens? _____
291 |
292 | The namespace is destroyed. You can prevent this by creating a bind mount inside the namespace.
293 |
294 |
295 |
296 |
297 | The _____ namespace allows processes inside one to have their own network stack: sockets, iptables, routing tables and network interfaces (including loopback)
298 |
299 | net
300 |
301 |
302 |
303 |
304 | The command _____ moves a network interface eth0 to namespace ns0
305 |
306 | ip link set dev eth0 netns ns0
307 |
308 |
309 |
310 |
311 | A process is in a namespace. Which system resources can it see or affect? _____
312 |
313 | Only those allowed in the namespace.
314 |
315 |
316 |
317 |
318 | The _____ namespace lets a container mount something, and make it invisible to other containers.
319 |
320 | mnt
321 |
322 |
323 |
324 |
325 | The command _____ enters a Linux namespace
326 |
327 | nsenter
328 |
329 |
330 |
331 |
332 | The command _____ adds a process to an existing namespace
333 |
334 | setns
335 |
336 |
337 |
338 |
339 | The _____ directory contains the process's links to namespaces used by the process
340 |
341 | /proc/[pid]/ns/
342 |
343 |
344 |
--------------------------------------------------------------------------------
/docs/network.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | The command _____ displays the status of the network
4 |
5 | netstat
6 |
7 |
8 |
9 |
10 | The command netstat _____
11 |
12 | displays the status of the network
13 |
14 |
15 |
16 |
17 | Predefined ports used by the OS for short-lived client sockets are called _____ ports.
18 |
19 | Ephemeral
20 |
21 |
22 |
23 |
24 | The command ip link set veth1 netns ns1 _____
25 |
26 | adds a virtual ethernet interface to a network namespace
27 |
28 |
29 |
30 |
31 | The command _____ creates a network namespace
32 |
33 | ip netns add ns1
34 |
35 |
36 |
37 |
38 | The command _____ traces the route to a given host
39 |
40 | traceroute
41 |
42 |
43 |
44 |
45 | The command ip link _____
46 |
47 | lists network interfaces on the localhost
48 |
49 |
50 |
51 |
52 | The command ethtool _____
53 |
54 | shows Ethernet card settings
55 |
56 |
57 |
58 |
59 | The command ip addr _____
60 |
61 | shows network interfaces on the host system
62 |
63 |
64 |
65 |
66 | The command ip -n ns1 addr add 192.168.15.1 dev veth1 _____ ip -n ns1 link set veth1 up ip -n ns2 link set veth2 up assigns an IP to a network namespace
67 |
68 | ip -n ns2 addr add 192.168.15.2 dev veth2
69 |
70 |
71 |
72 |
73 | The command ip netns exec _____
74 |
75 | can be used to run commands inside a network namespace
76 |
77 |
78 |
79 |
80 | The command _____ displays remote hosts connected to yours on port 3333
81 |
82 | netstat -a | grep 3333
83 |
84 |
85 |
86 |
87 | The _____ file is a list of hostname-to-IP address mappings for resolving hostnames (DNS)
88 |
89 | /etc/hosts
90 |
91 |
92 |
93 |
94 | The command nslookup _____
95 |
96 | queries a website's name server
97 |
98 |
99 |
100 |
101 | The command _____ shows network interfaces on the host system
102 |
103 | ip addr
104 |
105 |
106 |
107 |
108 | To connect several network namespaces you need a virtual _____, ex. Linux Bridge or Open vSwitch
109 |
110 | switch / bridge network
111 |
112 |
113 |
114 |
115 | Can network namespaces (netns) implement network isolation? _____
116 |
117 | Yes
118 |
119 |
120 |
121 |
122 | The command ip -n ns1 link _____
123 |
124 | lists network interfaces inside a namespace
125 |
126 |
127 |
128 |
129 | The command _____ can be used to run commands inside a network namespace
130 |
131 | ip netns exec
132 |
133 |
134 |
135 |
136 | The command ip -n ns1 link del veth1 _____
137 |
138 | deletes a veth pair between namespaces
139 |
140 |
141 |
142 |
143 | The command ip route add blackhole $BANNED_IP _____
144 |
145 | blocks an IP from connecting to your host
146 |
147 |
148 |
149 |
150 | The tracert command uses the _____ network protocol
151 |
152 | ICMP
153 |
154 |
155 |
156 |
157 | The command ip link add veth1 type veth peer name veth2 _____
158 |
159 | links two virtual ethernet interfaces
160 |
161 |
162 |
163 |
164 | The command _____ queries a website's name server
165 |
166 | nslookup
167 |
168 |
169 |
170 |
171 | The command traceroute _____
172 |
173 | traces the route to a given host
174 |
175 |
176 |
177 |
178 | The command _____ links two virtual ethernet interfaces
179 |
180 | ip link add veth1 type veth peer name veth2
181 |
182 |
183 |
184 |
185 | The command _____ ip -n ns2 addr add 192.168.15.2 dev veth2 ip -n ns1 link set veth1 up ip -n ns2 link set veth2 up assigns an IP to a network namespace
186 |
187 | ip -n ns1 addr add 192.168.15.1 dev veth1
188 |
189 |
190 |
191 |
192 | The command ip -n ns1 addr add 192.168.15.1 dev veth1 ip -n ns2 addr add 192.168.15.2 dev veth2 ip -n ns1 link set veth1 up _____ assigns an IP to a network namespace
193 |
194 | ip -n ns2 link set veth2 up
195 |
196 |
197 |
198 |
199 | The command ip -n ns1 addr add 192.168.15.1 dev veth1 ip -n ns2 addr add 192.168.15.2 dev veth2 ip -n ns1 link set veth1 up ip -n ns2 link set veth2 up _____
200 |
201 | assigns an IP to a network namespace
202 |
203 |
204 |
205 |
206 | The command ip netns add ns1 _____
207 |
208 | creates a network namespace
209 |
210 |
211 |
212 |
213 | "The command ip link add veth1 type veth peer name veth1-bridge ip link set veth1-bridge master v-net-0 _____"
214 |
215 | links a veth interface ""veth1"" to a bridge network ""v-net-0""
216 |
217 |
218 |
219 |
220 | The command _____ lists network interfaces on the localhost
221 |
222 | ip link
223 |
224 |
225 |
226 |
227 | The command _____ finds the hostname of an IP address.
228 |
229 | dig
230 |
231 |
232 |
233 |
234 | The _____ file specifies the DNS server and domain suffix of the system.
235 |
236 | /etc/resolv.conf
237 |
238 |
239 |
240 |
241 | The command ip -n ns1 addr add 192.168.15.1 dev veth1 ip -n ns2 addr add 192.168.15.2 dev veth2 _____ ip -n ns2 link set veth2 up assigns an IP to a network namespace
242 |
243 | ip -n ns1 link set veth1 up
244 |
245 |
246 |
247 |
248 | The command _____ blocks an IP from connecting to your host
249 |
250 | ip route add blackhole $BANNED_IP
251 |
252 |
253 |
254 |
255 | The command netstat -a | grep 3333 _____
256 |
257 | displays remote hosts connected to yours on port 3333
258 |
259 |
260 |
261 |
262 | The command _____ lists network interfaces inside a namespace
263 |
264 | ip -n ns1 link
265 |
266 |
267 |
268 |
269 | "The command _____ links a veth interface ""veth1"" to a bridge network ""v-net-0"""
270 |
271 | ip link add veth1 type veth peer name veth1-bridge ip link set veth1-bridge master v-net-0
272 |
273 |
274 |
275 |
276 | The command dig _____
277 |
278 | finds the hostname of an IP address.
279 |
280 |
281 |
282 |
283 | The command _____ creates a new bridge network
284 |
285 | ip link add v-net-0 type bridge ip link set dev v-net-0 up
286 |
287 |
288 |
289 |
290 | The command _____ adds a virtual ethernet interface to a network namespace
291 |
292 | ip link set veth1 netns ns1
293 |
294 |
295 |
296 |
297 | The ping command uses the _____ network protocol
298 |
299 | ICMP
300 |
301 |
302 |
303 |
304 | The command ip link add v-net-0 type bridge ip link set dev v-net-0 up _____
305 |
306 | creates a new bridge network
307 |
308 |
309 |
310 |
311 | The command _____ deletes a veth pair between namespaces
312 |
313 | ip -n ns1 link del veth1
314 |
315 |
316 |
317 |
318 | The command _____ shows Ethernet card settings
319 |
320 | ethtool
321 |
322 |
323 |
--------------------------------------------------------------------------------
/docs/processes.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | named pipes are FIFO files creatable with mkfifo which allow communication between two _____ on the same host. Network sockets / local domain sockets have mostly superseded them.
4 |
5 | processes
6 |
7 |
8 |
9 |
10 | Can processes communicate via sockets? _____
11 |
12 | Yes
13 |
14 |
15 |
16 |
17 | The command _____ show process status
18 |
19 | ps
20 |
21 |
22 |
23 |
24 | The command _____ sends a job to the foreground
25 |
26 | fg
27 |
28 |
29 |
30 |
31 | The directory _____ predominantly stores Processes. The directory is a psuedo-filesystem, dynamically created whenever it is accessed
32 |
33 | /proc
34 |
35 |
36 |
37 |
38 | init (or systemd) is the process with PID _____ that executes system startup scripts.
39 |
40 | 1
41 |
42 |
43 |
44 |
45 | The file /proc/[pid]/stat contains _____
46 |
47 | the process's status information (decoded by the ps command)
48 |
49 |
50 |
51 |
52 | Each process has one or several execution contexts called _____, each with its own stack and CPU context, but the exact same address space as their process
53 |
54 | threads
55 |
56 |
57 |
58 |
59 | When you run the command ls: 1. Your input gets read by the shell via getline(). 2. The name is found within your $PATH directories. 3. The clone() _____ duplicates the process, giving the child a new PID. 4. The execve() _____ stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs wait(), as it will clean after the child process when finished
60 |
61 | syscall
62 |
63 |
64 |
65 |
66 | The command _____ shows processes of all users
67 |
68 | ps -a
69 |
70 |
71 |
72 |
73 | A process's _____ determinates how much CPU time it receives
74 |
75 | scheduling priority
76 |
77 |
78 |
79 |
80 | "When a process is cloned, we call the original process the ""_____"", and we call the clone the ""child"""
81 |
82 | parent
83 |
84 |
85 |
86 |
87 | The file _____ contains the process's command it's executing
88 |
89 | /proc/[pid]/cmd
90 |
91 |
92 |
93 |
94 | The command _____ shows processes along with their user/owner
95 |
96 | ps -u
97 |
98 |
99 |
100 |
101 | All other processes are directly or indirectly the children of _____
102 |
103 | The PID 1 process (init or systemd)
104 |
105 |
106 |
107 |
108 | The command ps -x _____
109 |
110 | shows procceses unattached to any terminal
111 |
112 |
113 |
114 |
115 | Cron's asterisk (* * * * *) syntax denotes, in order: minute, hour, _____, weekday
116 |
117 | day of the month
118 |
119 |
120 |
121 |
122 | When you run the command ls: 1. Your input gets read by the shell via getline(). 2. The name is found within your _____. 3. The clone() syscall duplicates the process, giving the child a new PID. 4. The execve() syscall stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs wait(), as it will clean after the child process when finished
123 |
124 | $PATH directories
125 |
126 |
127 |
128 |
129 | The crontab command schedules processes at regular intervals. The cron _____ executes and logs them
130 |
131 | daemon
132 |
133 |
134 |
135 |
136 | The command fuser _____
137 |
138 | identifies the process that is accessing a file
139 |
140 |
141 |
142 |
143 | The command jobs _____
144 |
145 | lists active jobs
146 |
147 |
148 |
149 |
150 | The file _____ contains the process's memory mapping information
151 |
152 | /proc/[pid]/maps
153 |
154 |
155 |
156 |
157 | The file _____ contains the process's complete command line
158 |
159 | /proc/[pid]/cmdline
160 |
161 |
162 |
163 |
164 | The file /proc/[pid]/cmdline contains _____
165 |
166 | the process's complete command line
167 |
168 |
169 |
170 |
171 | Cron's asterisk (* * * * *) syntax denotes, in order: minute, _____, day of the month, weekday
172 |
173 | hour
174 |
175 |
176 |
177 |
178 | Cron's asterisk (* * * * *) syntax denotes, in order: minute, hour, day of the month, _____
179 |
180 | weekday
181 |
182 |
183 |
184 |
185 | After a clone(), child processes usually run one of the _____ routines, replacing the process they've copied from their parent
186 |
187 | exec()
188 |
189 |
190 |
191 |
192 | The command setuid _____
193 |
194 | manipulates a process' UID
195 |
196 |
197 |
198 |
199 | The file _____ contains the process's symbolic link to its current directory
200 |
201 | /proc/[pid]/cwd
202 |
203 |
204 |
205 |
206 | The file /proc/[pid]/maps contains the process's _____
207 |
208 | memory mapping information
209 |
210 |
211 |
212 |
213 | The file /proc/[pid]/statm contains the process's _____
214 |
215 | memory usage info
216 |
217 |
218 |
219 |
220 | _____ are programs running indefinitely in the background
221 |
222 | daemons
223 |
224 |
225 |
226 |
227 | A process consists of an address space and a set of data structures in the _____
228 |
229 | kernel
230 |
231 |
232 |
233 |
234 | The command _____ prints the process tree of a process
235 |
236 | pstree -p [PID]
237 |
238 |
239 |
240 |
241 | Are PID's (process ID's) unique? _____
242 |
243 | Yes
244 |
245 |
246 |
247 |
248 | The command setgid _____
249 |
250 | manipulates a process's group
251 |
252 |
253 |
254 |
255 | The crontab command _____. The cron daemon executes and logs them
256 |
257 | schedules processes at regular intervals
258 |
259 |
260 |
261 |
262 | The crontab command schedules processes at regular intervals. The _____ daemon executes and logs them
263 |
264 | cron
265 |
266 |
267 |
268 |
269 | The command kill (without flags) sends the SIGTERM signal to a process. SIGTERM may not necessarily terminate the process, as this particular signal be either caught, _____ or ignored by the process.
270 |
271 | blocked
272 |
273 |
274 |
275 |
276 | When you run the command ls: 1. Your input gets read by the shell via getline(). 2. The name is found within your $PATH directories. 3. The clone() syscall duplicates the process, giving the child a new PID. 4. The _____ syscall stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs wait(), as it will clean after the child process when finished
277 |
278 | execve()
279 |
280 |
281 |
282 |
283 | Each process has one or several execution contexts called threads, each with its own stack and CPU context, but the exact same _____ as their process
284 |
285 | address space
286 |
287 |
288 |
289 |
290 | Each process has one or several execution contexts called threads, each with its own stack and _____, but the exact same address space as their process
291 |
292 | CPU context
293 |
294 |
295 |
296 |
297 | After a _____, child processes usually run one of the exec() routines, replacing the process they've copied from their parent
298 |
299 | clone()
300 |
301 |
302 |
303 |
304 | Before a dead process disappears, its death must be acknowledged by _____, who does so with a call to wait()
305 |
306 | its parent
307 |
308 |
309 |
310 |
311 | The file _____ contains the process's environment variables
312 |
313 | /proc/[pid]/environ
314 |
315 |
316 |
317 |
318 | The file _____ contains the process's memory usage info
319 |
320 | /proc/[pid]/statm
321 |
322 |
323 |
324 |
325 | The command _____ manipulates a process's group
326 |
327 | setgid
328 |
329 |
330 |
331 |
332 | A file is being read in a thread. The kernel requests the file's content be delivered into the requesting process's address space. Until it finishes, the thread is considered _____.
333 |
334 | sleeping
335 |
336 |
337 |
338 |
339 | Local domain sockets are connections between processes on the same host, creatable with the ______ system call.
340 |
341 | socket
342 |
343 |
344 |
345 |
346 | Which Linux syscalls create a new process? _____
347 |
348 | clone() copies an existing process, whose running command is replaced to a desired new command via exec()
349 |
350 |
351 |
352 |
353 | The command _____ limits the use of system-wide resources for a user
354 |
355 | ulimit
356 |
357 |
358 |
359 |
360 | A process's scheduling priority determinates how much _____ it receives
361 |
362 | CPU time
363 |
364 |
365 |
366 |
367 | Can processes communicate via named pipes? _____
368 |
369 | Yes
370 |
371 |
372 |
373 |
374 | The file _____ contains the process's status information (decoded by the ps command)
375 |
376 | /proc/[pid]/stat
377 |
378 |
379 |
380 |
381 | The file /proc/[pid]/cwd contains the process's _____
382 |
383 | symbolic link to its current directory
384 |
385 |
386 |
387 |
388 | The GID is the numeric identificator for a process's _____
389 |
390 | group
391 |
392 |
393 |
394 |
395 | "When a process is cloned, we call the original process the ""parent"", and we call the clone the ""_____"""
396 |
397 | child
398 |
399 |
400 |
401 |
402 | Can processes communicate via anonymous pipes? _____
403 |
404 | Yes
405 |
406 |
407 |
408 |
409 | Cron's _____ syntax denotes, in order: minute, hour, day of the month, weekday
410 |
411 | asterisk (* * * * *)
412 |
413 |
414 |
415 |
416 | Before a dead process disappears, its death must be acknowledged by its parent, who does so with a call to _____
417 |
418 | wait()
419 |
420 |
421 |
422 |
423 | The command kill (without flags) sends the _____ signal to a process. _____ may not necessarily terminate the process, as this particular signal be either caught, blocked or ignored by the process.
424 |
425 | SIGTERM
426 |
427 |
428 |
429 |
430 | The command ps -u _____
431 |
432 | shows processes along with their user/owner
433 |
434 |
435 |
436 |
437 | A _____ is the abstraction memory, processor time, I/O management and monitoring for a single running program
438 |
439 | Process
440 |
441 |
442 |
443 |
444 | Do threads share the stack and CPU context with their process? _____
445 |
446 | No
447 |
448 |
449 |
450 |
451 | When you run the command ls: 1. Your input gets read by the shell via getline(). 2. The name is found within your $PATH directories. 3. The _____ syscall duplicates the process, giving the child a new PID. 4. The execve() syscall stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs wait(), as it will clean after the child process when finished
452 |
453 | clone()
454 |
455 |
456 |
457 |
458 | The file /proc/[pid]/environ contains the process's _____
459 |
460 | environment variables
461 |
462 |
463 |
464 |
465 | The file _____ contains the process's symbolic link to its root directory (set via chroot)
466 |
467 | /proc/[pid]/root
468 |
469 |
470 |
471 |
472 | The command _____ is the modern version of fork that handles threads
473 |
474 | clone()
475 |
476 |
477 |
478 |
479 | A process' _____ is a set of memory pages that the kernel has marked for the procesS to use
480 |
481 | address space
482 |
483 |
484 |
485 |
486 | The command pstree -p [PID] _____
487 |
488 | prints the process tree of a process
489 |
490 |
491 |
492 |
493 | The command renice _____
494 |
495 | changes the priority of a running process
496 |
497 |
498 |
499 |
500 | The command _____ displays processes in a user oriented format
501 |
502 | ps -u
503 |
504 |
505 |
506 |
507 | UTS stands for _____ and it gives a container its own hostname and domain name
508 |
509 | Unix Timesharing System
510 |
511 |
512 |
513 |
514 | The command ps -a _____
515 |
516 | shows processes of all users
517 |
518 |
519 |
520 |
521 | The command _____ changes the priority of a running process
522 |
523 | renice
524 |
525 |
526 |
527 |
528 | The command _____ shows a real-time, interactive list of processes
529 |
530 | top
531 |
532 |
533 |
534 |
535 | A parent process has died before it could clean up its child processes via a call to _____. What happens to the child processes? The PID 1 process (usually init or systemd) adopts them and calls wait
536 |
537 | wait
538 |
539 |
540 |
541 |
542 | The command top _____
543 |
544 | shows a real-time, interactive list of processes
545 |
546 |
547 |
548 |
549 | The command _____ (without flags) sends the SIGTERM signal to a process. SIGTERM may not necessarily terminate the process, as this particular signal be either caught, blocked or ignored by the process.
550 |
551 | kill
552 |
553 |
554 |
555 |
556 | The command ps _____
557 |
558 | show process status
559 |
560 |
561 |
562 |
563 | The _____ directory contains the process's information on open file descriptors
564 |
565 | /proc/[pid]/fdinfo/
566 |
567 |
568 |
569 |
570 | The command kill (without flags) sends the _____ signal to a process. _____ may not necessarily terminate the process, as this particular signal be either caught, blocked or ignored by the process.
571 |
572 | SIGTERM
573 |
574 |
575 |
576 |
577 | The file /proc/[pid]/root contains the process's _____
578 |
579 | symbolic link to its root directory (set via chroot)
580 |
581 |
582 |
583 |
584 | Jobs are identified by their _____ and JID (Job ID)
585 |
586 | PID (Process ID)
587 |
588 |
589 |
590 |
591 | The /proc/[pid]/fdinfo/ directory contains the process's _____
592 |
593 | information on open file descriptors
594 |
595 |
596 |
597 |
598 | The clone() syscall returns two values. To the parent it returns the PID of the new child. To the child it returns _____. This informs them both of what role they are playing in the forking
599 |
600 | 0
601 |
602 |
603 |
604 |
605 | The _____ command schedules processes at regular intervals. The cron daemon executes and logs them
606 |
607 | crontab
608 |
609 |
610 |
611 |
612 | The higher the niceness of a process, the _____ priority it has.
613 |
614 | lower
615 |
616 |
617 |
618 |
619 | Cron's asterisk (* * * * *) syntax denotes, in order: _____, hour, day of the month, weekday
620 |
621 | minute
622 |
623 |
624 |
625 |
626 | Can processes communicate via SysV queues? _____
627 |
628 | Yes
629 |
630 |
631 |
632 |
633 | daemons are _____
634 |
635 | programs running indefinitely in the background
636 |
637 |
638 |
639 |
640 | The command _____ shows procceses unattached to any terminal
641 |
642 | ps -x
643 |
644 |
645 |
646 |
647 | The file /proc/exe contains the process's _____
648 |
649 | symbolic link to the executed file
650 |
651 |
652 |
653 |
654 | The command _____ inversely sets the priority of a process (the lower the niceness, the higher the priority)
655 |
656 | nice
657 |
658 |
659 |
660 |
661 | Can processes communicate via D-Bus? _____
662 |
663 | Yes
664 |
665 |
666 |
667 |
668 | The command fg _____
669 |
670 | sends a job to the foreground
671 |
672 |
673 |
674 |
675 | The directory /proc predominantly stores Processes. The directory is a psuedo-filesystem, _____
676 |
677 | dynamically created whenever it is accessed
678 |
679 |
680 |
681 |
682 | Can processes communicate via SysV semaphores? _____
683 |
684 | Yes
685 |
686 |
687 |
688 |
689 | Can processes communicate via SysV shared memory? _____
690 |
691 | Yes
692 |
693 |
694 |
695 |
696 | The command ulimit _____
697 |
698 | limits the use of system-wide resources for a user
699 |
700 |
701 |
702 |
703 | A process' address space is _____
704 |
705 | a set of memory pages that the kernel has marked for the procesS to use
706 |
707 |
708 |
709 |
710 | The file /proc/[pid]/cmd contains _____
711 |
712 | the process's command it's executing
713 |
714 |
715 |
716 |
717 | The command _____ manipulates a process' UID
718 |
719 | setuid
720 |
721 |
722 |
723 |
724 | A process' _____ is the user identification number (inherited from the parent process) of the user who created it. Usually, only the creator of a process, and the superuser, can manipulate the process.
725 |
726 | UID
727 |
728 |
729 |
730 |
731 | named pipes are FIFO files creatable with _____ which allow communication between two processes on the same host. Network sockets / local domain sockets have mostly superseded them.
732 |
733 | mkfifo
734 |
735 |
736 |
737 |
738 | A process' _____ contain variables, code, libraries, stacks and kernel-specific information that the process needs to execute
739 |
740 | address space memory pages
741 |
742 |
743 |
744 |
745 | When you run the command ls: 1. Your input gets read by the shell via getline(). 2. The name is found within your $PATH directories. 3. The clone() syscall duplicates the process, giving the child a new PID. 4. The execve() syscall stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs _____, as it will clean after the child process when finished
746 |
747 | wait()
748 |
749 |
750 |
751 |
752 | A parent process has died before it could clean up its child processes via a call to wait. What happens to the child processes? _____
753 |
754 | The PID 1 process (usually init or systemd) adopts them and calls wait
755 |
756 |
757 |
758 |
759 | The file _____ contains the process's symbolic link to the executed file
760 |
761 | /proc/exe
762 |
763 |
764 |
765 |
766 | The clone() syscall returns two values. To the parent it returns _____. To the child it returns 0. This informs them both of what role they are playing in the forking
767 |
768 | the PID of the new child
769 |
770 |
771 |
772 |
773 | Can processes communicate via FIFO pipes? _____
774 |
775 | Yes
776 |
777 |
778 |
779 |
780 | When you run the command ls: 1. Your input gets read by the shell via getline(). 2. The name is found within your $PATH directories. 3. The clone() _____ duplicates the process, giving the child a new PID. 4. The execve() _____ stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs wait(), as it will clean after the child process when finished
781 |
782 | syscall
783 |
784 |
785 |
786 |
787 | Upon a process's death, does its parent receive a copy of the exit code? _____
788 |
789 | Yes
790 |
791 |
792 |
793 |
794 | The _____ of a child process refers to the PID of the process from which it was cloned.
795 |
796 | PPID
797 |
798 |
799 |
800 |
801 | The command kill (without flags) sends the SIGTERM signal to a process. SIGTERM may not necessarily terminate the process, as this particular signal be either caught, blocked or _____ by the process.
802 |
803 | ignored
804 |
805 |
806 |
807 |
808 | A process's place in the _____ contains its function parameters, local variables, return addresses and temporary data
809 |
810 | stack
811 |
812 |
813 |
814 |
815 | the _____ syscall creates a copy of the original process, with a new PID
816 |
817 | clone()
818 |
819 |
820 |
821 |
822 | A file is being read in a thread. The kernel requests the file's content be delivered into the requesting process's _____. Until it finishes, the thread is considered sleeping.
823 |
824 | address space
825 |
826 |
827 |
828 |
829 | _____ are FIFO files creatable with mkfifo which allow communication between two processes on the same host. Network sockets / local domain sockets have mostly superseded them.
830 |
831 | named pipes
832 |
833 |
834 |
835 |
836 | A process consists of an _____ and a set of data structures in the kernel
837 |
838 | address space
839 |
840 |
841 |
842 |
843 | When a process completes, it calls the exit routine, notifying the kernel that it is ready to be die, along with an integer _____ indicating the reason why
844 |
845 | exit code
846 |
847 |
848 |
849 |
850 | Processes that have finished execution but had not yet been cleaned up by their parent are called _____ processes.
851 |
852 | zombie
853 |
854 |
855 |
856 |
857 | The command nice _____
858 |
859 | inversely sets the priority of a process (the lower the niceness, the higher the priority)
860 |
861 |
862 |
863 |
864 | The command _____ identifies the process that is accessing a file
865 |
866 | fuser
867 |
868 |
869 |
870 |
871 | When a process completes, it calls the _____ routine, notifying the kernel that it is ready to be die, along with an integer exit code indicating the reason why
872 |
873 | exit
874 |
875 |
876 |
877 |
878 | The command ps -u _____
879 |
880 | displays processes in a user oriented format
881 |
882 |
883 |
884 |
885 | Do threads share the same address space as their process? _____
886 |
887 | Yes
888 |
889 |
890 |
891 |
892 | The command kill (without flags) sends the SIGTERM signal to a process. SIGTERM may not necessarily terminate the process, as this particular signal be either _____, blocked or ignored by the process.
893 |
894 | caught
895 |
896 |
897 |
898 |
899 | The _____ is the numeric identificator for a process's group
900 |
901 | GID
902 |
903 |
904 |
905 |
906 | _____ are a soft limit on containers - the more of them a container has, the more prioritized it is by a scheduler
907 |
908 | CPU shares
909 |
910 |
911 |
912 |
913 | The command _____ lists active jobs
914 |
915 | jobs
916 |
917 |
918 |
919 |
920 | When you run the command ls: 1. Your input gets read by the shell via _____ 2. The name is found within your $PATH directories. 3. The clone() syscall duplicates the process, giving the child a new PID. 4. The execve() syscall stops the child and replaces its memory stack with data from the ls binary. 5. The parent process runs wait(), as it will clean after the child process when finished
921 |
922 | getline().
923 |
924 |
925 |
926 |
927 | Jobs are identified by their PID (Process ID) and _____
928 |
929 | JID (Job ID)
930 |
931 |
932 |
933 |
934 | The command clone() _____
935 |
936 | is the modern version of fork that handles threads
937 |
938 |
939 |
940 |
941 | "A process is considered """"asleep"""" when _____"""
942 |
943 | All of its threads are asleep (i.e. waiting for the kernel to finish something for them, like reading contents of a file)
944 |
945 |
946 |
947 |
948 | The file _____ directory contains the process's links to open file descriptors
949 |
950 | /proc/[pid]/fd/
951 |
952 |
953 |
954 |
955 | Each process has one or several execution contexts called threads, each with its own _____ and CPU context, but the exact same address space as their process
956 |
957 | stack
958 |
959 |
960 |
961 |
962 | The file /proc/[pid]/fd/ directory contains the process's _____
963 |
964 | links to open file descriptors
965 |
966 |
967 |
--------------------------------------------------------------------------------
/docs/security.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | The command useradd _____
4 |
5 | creates a new user account.
6 |
7 |
8 |
9 |
10 | The command _____ changes a file's owner or group.
11 |
12 | chown
13 |
14 |
15 |
16 |
17 | The command _____ changes a user's password.
18 |
19 | passwd
20 |
21 |
22 |
23 |
24 | Default shell files should have default value of _____ set, for example to 077
25 |
26 | umask
27 |
28 |
29 |
30 |
31 | Debian's password encryption algorithm is set by Pluggable Authentication Modules (PAM) in the _____ file
32 |
33 | /etc/pam.d/common-passwd
34 |
35 |
36 |
37 |
38 | Encrypted Linux passwords all have the same _____, even if the unencrypted passwords do not
39 |
40 | length
41 |
42 |
43 |
44 |
45 | the chmod _____ permission means READ permission for owner, group and public
46 |
47 | 0444
48 |
49 |
50 |
51 |
52 | The command _____ modifies a group
53 |
54 | groupmod
55 |
56 |
57 |
58 |
59 | The command _____ modifies a user account.
60 |
61 | usermod
62 |
63 |
64 |
65 |
66 | gVisor is a _____ that can sandbox syscalls in userspace via restricted seccomp filters
67 |
68 | kernel security module
69 |
70 |
71 |
72 |
73 | The /etc/passwd file stores _____
74 |
75 | users and data about them
76 |
77 |
78 |
79 |
80 | The _____ file contains group definitions.
81 |
82 | /etc/group
83 |
84 |
85 |
86 |
87 | the chmod 0111 permission means EXECUTE permission for _____
88 |
89 | owner, group and public
90 |
91 |
92 |
93 |
94 | Login names can never contain colons or newlines - these characters are used as field and entry separators in the _____ file respectively
95 |
96 | /etc/passwd
97 |
98 |
99 |
100 |
101 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: username:password:Last password change:Minimum days required between password changes:_____:password expiration warning duration:password expiration ban deadline:{{c10::account expiration date}}
102 |
103 | Maximum days between password changes
104 |
105 |
106 |
107 |
108 | _____ filters decide which syscalls are allowed inside in a system. This prevents signals from being arbitrarily ran by an attacker, or being used to break out of a Linux namespace via unshare
109 |
110 | seccomp
111 |
112 |
113 |
114 |
115 | The root, system, or wheel group always has GID of _____
116 |
117 | 0
118 |
119 |
120 |
121 |
122 | AppArmor profiles in complain mode _____
123 |
124 | report violations
125 |
126 |
127 |
128 |
129 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: _____:password:UID:Default GID:comments:home:shell
130 |
131 | username
132 |
133 |
134 |
135 |
136 | AppArmor profiles in _____ mode block access to disallowed resources
137 |
138 | enforcing
139 |
140 |
141 |
142 |
143 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: _____:password:Last password change:Minimum days required between password changes:Maximum days between password changes:password expiration warning duration:password expiration ban deadline:{{c10::account expiration date}}
144 |
145 | username
146 |
147 |
148 |
149 |
150 | The command _____ sets a password for a user
151 |
152 | passwd [username]
153 |
154 |
155 |
156 |
157 | The command _____ reconciles the contents of the /etc/shadow and /etc/passwd files
158 |
159 | pwconv
160 |
161 |
162 |
163 |
164 | root user's UID always equals _____
165 |
166 | 0
167 |
168 |
169 |
170 |
171 | the chmod 0444 permission means _____ permission for owner, group and public
172 |
173 | READ
174 |
175 |
176 |
177 |
178 | The command _____ sets a group's password, allowing users to enter it
179 |
180 | gpasswd
181 |
182 |
183 |
184 |
185 | RHEL's password encryption algorithm is set in the /etc/login.defs file, or through the _____ command
186 |
187 | authconfig
188 |
189 |
190 |
191 |
192 | The command _____ can change a user’s configuration through editing the /etc/passwd file
193 |
194 | vipw
195 |
196 |
197 |
198 |
199 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: username:password:Last password change:Minimum days required between password changes:Maximum days between password changes:password expiration warning duration:_____:{{c10::account expiration date}}
200 |
201 | password expiration ban deadline
202 |
203 |
204 |
205 |
206 | seccomp filters decide which _____ are allowed inside in a system. This prevents signals from being arbitrarily ran by an attacker, or being used to break out of a Linux namespace via unshare
207 |
208 | syscalls
209 |
210 |
211 |
212 |
213 | Debian's password encryption algorithm is set by _____ in the /etc/pam.d/common-passwd file
214 |
215 | Pluggable Authentication Modules (PAM)
216 |
217 |
218 |
219 |
220 | the chmod 0111 permission means _____ permission for owner, group and public
221 |
222 | EXECUTE
223 |
224 |
225 |
226 |
227 | The command userdel _____
228 |
229 | deletes a user account.
230 |
231 |
232 |
233 |
234 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: username:password:_____:Minimum days required between password changes:Maximum days between password changes:password expiration warning duration:password expiration ban deadline:{{c10::account expiration date}}
235 |
236 | Last password change
237 |
238 |
239 |
240 |
241 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: username:password:UID:Default GID:comments:home:_____
242 |
243 | shell
244 |
245 |
246 |
247 |
248 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: username:password:UID:Default GID:comments:_____:shell
249 |
250 | home
251 |
252 |
253 |
254 |
255 | Pseudo-users have a _____, and therefore cannot be logged into. They are commonly defined as owners of commands and configuration files
256 |
257 | fake login shell
258 |
259 |
260 |
261 |
262 | _____ is a kernel security module that confines programs to a limited set of resources, reducing an application's attack surface
263 |
264 | AppArmor
265 |
266 |
267 |
268 |
269 | The /etc/shadow password file is readable only by _____
270 |
271 | the superuser
272 |
273 |
274 |
275 |
276 | "The command _____ searches the /var/log/ directory for usages of the word ""login"""
277 |
278 | grep login /var/log/*
279 |
280 |
281 |
282 |
283 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: username:password:Last password change:Minimum days required between password changes:Maximum days between password changes:_____:password expiration ban deadline:{{c10::account expiration date}}
284 |
285 | password expiration warning duration
286 |
287 |
288 |
289 |
290 | sh reads _____ before reading ~/.profile and ~/.bash_profile
291 |
292 | /etc/profile
293 |
294 |
295 |
296 |
297 | the chmod 0222 permission means _____ permission for owner, group and public
298 |
299 | WRITE
300 |
301 |
302 |
303 |
304 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands useradd, adduser, usermod, _____, vipw, vipw -s and chsh instead
305 |
306 | pw
307 |
308 |
309 |
310 |
311 | Are login names case-sensitive? _____
312 |
313 | Yes
314 |
315 |
316 |
317 |
318 | The command _____ deletes a user account.
319 |
320 | userdel
321 |
322 |
323 |
324 |
325 | Human user UIDs should equal to _____
326 |
327 | 1000 or higher
328 |
329 |
330 |
331 |
332 | A user's group memberships equals the union of those defined for the user in /etc/passwd and _____
333 |
334 | /etc/group
335 |
336 |
337 |
338 |
339 | gVisor is a kernel security module that can _____ syscalls in userspace via restricted seccomp filters
340 |
341 | sandbox
342 |
343 |
344 |
345 |
346 | AppArmor profiles configure access to capabilities, network access, file permissions, either in _____ or complain mode
347 |
348 | enforcing
349 |
350 |
351 |
352 |
353 | The _____ file stores users and data about them
354 |
355 | /etc/passwd
356 |
357 |
358 |
359 |
360 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands useradd, _____, usermod, pw, vipw, vipw -s and chsh instead
361 |
362 | adduser
363 |
364 |
365 |
366 |
367 | The command chown _____
368 |
369 | changes a file's owner or group.
370 |
371 |
372 |
373 |
374 | A Linux user is represented by its number: the _____
375 |
376 | user ID or UID
377 |
378 |
379 |
380 |
381 | A user's group memberships equals the union of those defined for the user in _____ and /etc/group
382 |
383 | /etc/passwd
384 |
385 |
386 |
387 |
388 | The command passwd _____
389 |
390 | changes a user's password.
391 |
392 |
393 |
394 |
395 | New files are typically owned by the user's _____ group
396 |
397 | effective
398 |
399 |
400 |
401 |
402 | Edit /etc/group by running _____ and /etc/gshadow by running vigr -s
403 |
404 | vigr
405 |
406 |
407 |
408 |
409 | Do login names have to be unique? _____
410 |
411 | Yes
412 |
413 |
414 |
415 |
416 | Each line in the /etc/passwd file represents a _____. A line's colon-separated fields represent: username:password:UID:Default GID:comments:home:shell
417 |
418 | user
419 |
420 |
421 |
422 |
423 | The command whoami displays _____
424 |
425 | the currently logged in user
426 |
427 |
428 |
429 |
430 | Group names should be limited to _____ characters for compatibility
431 |
432 | 8
433 |
434 |
435 |
436 |
437 | AppArmor profiles in enforcing mode _____
438 |
439 | block access to disallowed resources
440 |
441 |
442 |
443 |
444 | The _____ password file is readable only by the superuser
445 |
446 | /etc/shadow
447 |
448 |
449 |
450 |
451 | A line in the /etc/group file represents a single group. Its fields are separated by colons: Name:Password:GID:_____
452 |
453 | Members, separated by commas
454 |
455 |
456 |
457 |
458 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: username:password:UID:_____:comments:home:shell
459 |
460 | Default GID
461 |
462 |
463 |
464 |
465 | The command _____ displays the groups a user belongs to
466 |
467 | groups
468 |
469 |
470 |
471 |
472 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands _____, adduser, usermod, pw, vipw, vipw -s and chsh instead
473 |
474 | useradd
475 |
476 |
477 |
478 |
479 | AppArmor profiles configure access to capabilities, network access, file permissions, either in enforcing or _____ mode
480 |
481 | complain
482 |
483 |
484 |
485 |
486 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: username:password:_____:Default GID:comments:home:shell
487 |
488 | UID
489 |
490 |
491 |
492 |
493 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: username:_____:Last password change:Minimum days required between password changes:Maximum days between password changes:password expiration warning duration:password expiration ban deadline:{{c10::account expiration date}}
494 |
495 | password
496 |
497 |
498 |
499 |
500 | The command usermod _____
501 |
502 | modifies a user account.
503 |
504 |
505 |
506 |
507 | The command id displays _____
508 |
509 | user and group ID's
510 |
511 |
512 |
513 |
514 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands useradd, adduser, usermod, pw, _____, vipw -s and chsh instead
515 |
516 | vipw
517 |
518 |
519 |
520 |
521 | the chmod _____ permission means EXECUTE permission for owner, group and public
522 |
523 | 0111
524 |
525 |
526 |
527 |
528 | AppArmor _____ configure access to capabilities, network access, file permissions, either in enforcing or complain mode
529 |
530 | profiles
531 |
532 |
533 |
534 |
535 | The command _____ adds a user group
536 |
537 | groupadd
538 |
539 |
540 |
541 |
542 | The /etc/shadow file contains _____
543 |
544 | encrypted passwords.
545 |
546 |
547 |
548 |
549 | _____ profiles configure access to capabilities, network access, file permissions, either in enforcing or complain mode
550 |
551 | AppArmor
552 |
553 |
554 |
555 |
556 | AppArmor is a kernel security module that confines programs to _____, reducing an application's attack surface
557 |
558 | a limited set of resources
559 |
560 |
561 |
562 |
563 | The _____ file contains encrypted passwords.
564 |
565 | /etc/shadow
566 |
567 |
568 |
569 |
570 | Linux passwords are encrypted with a random _____, allowing them to have several encrypted forms, especially if several users use the same password
571 |
572 | salt
573 |
574 |
575 |
576 |
577 | Linux typically encrypts passwords under the _____ cryptographic function
578 |
579 | SHA-512
580 |
581 |
582 |
583 |
584 | Each line in the _____ file represents a user. A line's colon-separated fields represent: username:password:UID:Default GID:comments:home:shell
585 |
586 | /etc/passwd
587 |
588 |
589 |
590 |
591 | Edit _____ by running vigr and /etc/gshadow by running vigr -s
592 |
593 | /etc/group
594 |
595 |
596 |
597 |
598 | The command groupadd _____
599 |
600 | adds a user group
601 |
602 |
603 |
604 |
605 | The command vipw can change a user’s configuration through editing the _____ file
606 |
607 | /etc/passwd
608 |
609 |
610 |
611 |
612 | the chmod 0444 permission means READ permission for _____
613 |
614 | owner, group and public
615 |
616 |
617 |
618 |
619 | Human groups should have GID of _____
620 |
621 | 1000 or higher
622 |
623 |
624 |
625 |
626 | The commands useradd, usermod and userdel can be configured via the files /etc/login.defs and _____
627 |
628 | /etc/default/useradd
629 |
630 |
631 |
632 |
633 | the chmod _____ permission means WRITE permission for owner, group and public
634 |
635 | 0222
636 |
637 |
638 |
639 |
640 | The command _____ changes a user's login shell
641 |
642 | chsh
643 |
644 |
645 |
646 |
647 | The command _____ lists users who are logged in.
648 |
649 | users
650 |
651 |
652 |
653 |
654 | A line in the /etc/group file represents a single group. Its fields are separated by colons: _____:Password:GID:Members, separated by commas
655 |
656 | Name
657 |
658 |
659 |
660 |
661 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands useradd, adduser, usermod, pw, vipw, _____ and chsh instead
662 |
663 | vipw -s
664 |
665 |
666 |
667 |
668 | The command groups displays _____
669 |
670 | the groups a user belongs to
671 |
672 |
673 |
674 |
675 | A line in the /etc/group file represents a single group. Its fields are separated by colons: Name:Password:_____:Members, separated by commas
676 |
677 | GID
678 |
679 |
680 |
681 |
682 | Edit /etc/group by running vigr and /etc/gshadow by running _____
683 |
684 | vigr -s
685 |
686 |
687 |
688 |
689 | A line in the _____ file represents a single group. Its fields are separated by colons: Name:Password:GID:Members, separated by commas
690 |
691 | /etc/group
692 |
693 |
694 |
695 |
696 | The _____ file configures password expiration, encryption algorithms, UID ranges and GID ranges
697 |
698 | login.defs
699 |
700 |
701 |
702 |
703 | The command pwconv reconciles the contents of the /etc/shadow and _____ files
704 |
705 | /etc/passwd
706 |
707 |
708 |
709 |
710 | Each line of the _____ password file represents a user. The user's fields are separated by colons: username:password:Last password change:Minimum days required between password changes:Maximum days between password changes:password expiration warning duration:password expiration ban deadline:{{c10::account expiration date}}
711 |
712 | /etc/shadow
713 |
714 |
715 |
716 |
717 | The command users _____
718 |
719 | lists users who are logged in.
720 |
721 |
722 |
723 |
724 | _____ is a kernel security module that can sandbox syscalls in userspace via restricted seccomp filters
725 |
726 | gVisor
727 |
728 |
729 |
730 |
731 | The command _____ displays the currently logged in user
732 |
733 | whoami
734 |
735 |
736 |
737 |
738 | The commands useradd, usermod and userdel can be configured via the files _____ and /etc/default/useradd
739 |
740 | /etc/login.defs
741 |
742 |
743 |
744 |
745 | Each line of the /etc/shadow password file represents a user. The user's fields are separated by colons: username:password:Last password change:_____:Maximum days between password changes:password expiration warning duration:password expiration ban deadline:{{c10::account expiration date}}
746 |
747 | Minimum days required between password changes
748 |
749 |
750 |
751 |
752 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: username:password:UID:Default GID:_____:home:shell
753 |
754 | comments
755 |
756 |
757 |
758 |
759 | Users managed through LDAP (or other directory service) might have special entries in the /etc/passwd file beginning with _____, integrating the file with the directory service
760 |
761 | + or -
762 |
763 |
764 |
765 |
766 | The /etc/group file contains _____
767 |
768 | group definitions.
769 |
770 |
771 |
772 |
773 | The _____ GID is used during creation of new files and directories
774 |
775 | default
776 |
777 |
778 |
779 |
780 | Edit /etc/group by running vigr and _____ by running vigr -s
781 |
782 | /etc/gshadow
783 |
784 |
785 |
786 |
787 | Grant a user sudo privileges by adding their username to the _____ file
788 |
789 | sudoers
790 |
791 |
792 |
793 |
794 | The _____ group always has GID of 0
795 |
796 | root, system, or wheel
797 |
798 |
799 |
800 |
801 | You can generate AppArmor profiles using the _____ generation tool
802 |
803 | Bane (https://github.com/jfrazelle/bane)
804 |
805 |
806 |
807 |
808 | Each line in the /etc/passwd file represents a user. A line's colon-separated fields represent: username:_____:UID:Default GID:comments:home:shell
809 |
810 | password
811 |
812 |
813 |
814 |
815 | gVisor is a kernel security module that can sandbox _____ in userspace via restricted seccomp filters
816 |
817 | syscalls
818 |
819 |
820 |
821 |
822 | seccomp filters decide which syscalls are allowed inside in a system. This prevents signals from being arbitrarily ran by an attacker, or being used to break out of a Linux namespace via _____
823 |
824 | unshare
825 |
826 |
827 |
828 |
829 | A line in the /etc/group file represents a single group. Its fields are separated by colons: Name:_____:GID:Members, separated by commas
830 |
831 | Password
832 |
833 |
834 |
835 |
836 | The command _____ displays user and group ID's
837 |
838 | id
839 |
840 |
841 |
842 |
843 | The command chage -d 0 username _____
844 |
845 | invalidates a user’s password and forces an update
846 |
847 |
848 |
849 |
850 | gVisor is a kernel security module that can sandbox syscalls in userspace via _____
851 |
852 | restricted seccomp filters
853 |
854 |
855 |
856 |
857 | The _____ directory holds sample startup files
858 |
859 | /etc/skel
860 |
861 |
862 |
863 |
864 | The command _____ invalidates a user’s password and forces an update
865 |
866 | chage -d 0 username
867 |
868 |
869 |
870 |
871 | AppArmor is a _____ that confines programs to a limited set of resources, reducing an application's attack surface
872 |
873 | kernel security module
874 |
875 |
876 |
877 |
878 | It is best practice that a human user should have the same consistent login name and _____ across all machines they use
879 |
880 | UID
881 |
882 |
883 |
884 |
885 | The command groupmod_____
886 |
887 | modifies a group
888 |
889 |
890 |
891 |
892 | The command groupdel _____
893 |
894 | deletes a group
895 |
896 |
897 |
898 |
899 | The /etc/skel directory holds _____
900 |
901 | sample startup files
902 |
903 |
904 |
905 |
906 | It is best practice that a human user should have the same consistent _____ and UID across all machines they use
907 |
908 | login name
909 |
910 |
911 |
912 |
913 | The _____ file defines groups
914 |
915 | /etc/group
916 |
917 |
918 |
919 |
920 | The command _____ creates a new user account.
921 |
922 | useradd
923 |
924 |
925 |
926 |
927 | LDAP and /etc/passwd integration can be configured in the _____ file
928 |
929 | /etc/nsswitch.conf
930 |
931 |
932 |
933 |
934 | The command _____ deletes a group
935 |
936 | groupdel
937 |
938 |
939 |
940 |
941 | RHEL's password encryption algorithm is set in the _____ file, or through the authconfig command
942 |
943 | /etc/login.defs
944 |
945 |
946 |
947 |
948 | gVisor is a kernel security module that can sandbox syscalls in _____ via restricted seccomp filters
949 |
950 | userspace
951 |
952 |
953 |
954 |
955 | Linux limits login length to _____ characters
956 |
957 | 32
958 |
959 |
960 |
961 |
962 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands useradd, adduser, _____, pw, vipw, vipw -s and chsh instead
963 |
964 | usermod
965 |
966 |
967 |
968 |
969 | The command pwconv reconciles the contents of the _____ and /etc/passwd files
970 |
971 | /etc/shadow
972 |
973 |
974 |
975 |
976 | To manually create a new Linux user, add them into the files: _____
977 |
978 | /etc/passwd, /etc/shadow and /etc/group
979 |
980 |
981 |
982 |
983 | the chmod 0222 permission means WRITE permission for _____
984 |
985 | owner, group and public
986 |
987 |
988 |
989 |
990 | Never manually edit /etc/passwd, /etc/group or /etc/shadow. Use the commands useradd, adduser, usermod, pw, vipw, vipw -s and _____ instead
991 |
992 | chsh
993 |
994 |
995 |
996 |
997 | Users managed through LDAP (or other directory service) might have special entries in the _____ file beginning with + or -, integrating the file with the directory service
998 |
999 | /etc/passwd
1000 |
1001 |
1002 |
1003 |
1004 | "The command grep login /var/log/* _____"
1005 |
1006 | searches the /var/log/ directory for usages of the word ""login""
1007 |
1008 |
1009 |
--------------------------------------------------------------------------------
/docs/shell.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | The command _____ displays a message on the screen
4 |
5 | echo
6 |
7 |
8 |
9 |
10 | The command _____ sleeps for a given time
11 |
12 | sleep
13 |
14 |
15 |
16 |
17 | The PATH _____ stores a list of directories that are searched for the binary of any command typed into a terminal
18 |
19 | environment variable
20 |
21 |
22 |
23 |
24 | The command _____ removes a variable or a function
25 |
26 | unset
27 |
28 |
29 |
30 |
31 | The command _____ can display lines which begin with a specified string
32 |
33 | look
34 |
35 |
36 |
37 |
38 | The command read _____
39 |
40 | reads a line from stdin
41 |
42 |
43 |
44 |
45 | The PATH environment variable stores a list of directories that are searched for _____ of any command typed into a terminal
46 |
47 | the binary
48 |
49 |
50 |
51 |
52 | Enclosing a string between _____ characters makes it literal.
53 |
54 | single quote
55 |
56 |
57 |
58 |
59 | The command getopts _____
60 |
61 | parses bash positional arguments
62 |
63 |
64 |
65 |
66 | The command _____ can fit text to a desired width
67 |
68 | fold
69 |
70 |
71 |
72 |
73 | The command bg _____
74 |
75 | sends a process to the background
76 |
77 |
78 |
79 |
80 | The command _____ reads a line from stdin
81 |
82 | read
83 |
84 |
85 |
86 |
87 | The command _____ declares variables
88 |
89 | declare
90 |
91 |
92 |
93 |
94 | The command _____ re-runs the last command
95 |
96 | !!
97 |
98 |
99 |
100 |
101 | The command set _____
102 |
103 | changes a config variable of the running shell
104 |
105 |
106 |
107 |
108 | "Enclosing a string between backtick `` characters makes it act as a command. Example: _____"
109 |
110 | echo ""Hello `whoami`""
111 |
112 |
113 |
114 |
115 | The command _____ swaps the stdout and stderr of a command
116 |
117 | 3>&2 2>&1 1>&3
118 |
119 |
120 |
121 |
122 | The command unset _____
123 |
124 | removes a variable or a function
125 |
126 |
127 |
128 |
129 | The PATH environment variable stores a _____ that are searched for the binary of any command typed into a terminal
130 |
131 | list of directories
132 |
133 |
134 |
135 |
136 | The command su _____
137 |
138 | executes commands as another system user
139 |
140 |
141 |
142 |
143 | The command _____ parses bash positional arguments
144 |
145 | getopts
146 |
147 |
148 |
149 |
150 | The command echo _____
151 |
152 | displays a message on the screen
153 |
154 |
155 |
156 |
157 | The command _____ executes commands as another system user
158 |
159 | su
160 |
161 |
162 |
163 |
164 | The command !! _____
165 |
166 | re-runs the last command
167 |
168 |
169 |
170 |
171 | The command eval _____
172 |
173 | evaluates commands and arguments passed to it
174 |
175 |
176 |
177 |
178 | The command sleep _____
179 |
180 | sleeps for a given time
181 |
182 |
183 |
184 |
185 | The command _____ configures wireless network interfaces
186 |
187 | iwconfig
188 |
189 |
190 |
191 |
192 | The command _____ defines bash functions
193 |
194 | function
195 |
196 |
197 |
198 |
199 | The command _____ changes a config variable of the running shell
200 |
201 | set
202 |
203 |
204 |
205 |
206 | The command declare _____
207 |
208 | declares variables
209 |
210 |
211 |
212 |
213 | The command fold _____
214 |
215 | can fit text to a desired width
216 |
217 |
218 |
219 |
220 | The command _____ sorts text numerically
221 |
222 | sort -n
223 |
224 |
225 |
226 |
227 | The command _____ evaluates commands and arguments passed to it
228 |
229 | eval
230 |
231 |
232 |
233 |
234 | The command expr _____
235 |
236 | evaluates expressions
237 |
238 |
239 |
240 |
241 | The command fmt _____
242 |
243 | can be used to format text
244 |
245 |
246 |
247 |
248 | The command _____ evaluates expressions
249 |
250 | expr
251 |
252 |
253 |
254 |
255 | The command 3>&2 2>&1 1>&3 _____
256 |
257 | swaps the stdout and stderr of a command
258 |
259 |
260 |
261 |
262 | The command iwconfig _____
263 |
264 | configures wireless network interfaces
265 |
266 |
267 |
268 |
269 | The command _____ can be used to format text
270 |
271 | fmt
272 |
273 |
274 |
275 |
276 | The command look _____
277 |
278 | can display lines which begin with a specified string
279 |
280 |
281 |
282 |
283 | The command sort -n _____
284 |
285 | sorts text numerically
286 |
287 |
288 |
289 |
290 | The command function _____
291 |
292 | defines bash functions
293 |
294 |
295 |
296 |
297 | The command local _____
298 |
299 | creates a local variable
300 |
301 |
302 |
303 |
304 | The command _____ creates a local variable
305 |
306 | local
307 |
308 |
309 |
310 |
311 | The command _____ sends a process to the background
312 |
313 | bg
314 |
315 |
316 |
317 |
318 | The _____ environment variable stores a list of directories that are searched for the binary of any command typed into a terminal
319 |
320 | PATH
321 |
322 |
323 |
--------------------------------------------------------------------------------
/docs/signals.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Which signal can you send using the kill command? _____
4 |
5 | Any signal!
6 |
7 |
8 |
9 |
10 | Signal 11 is _____
11 |
12 | SIGSEGV (Segmentation fault)
13 |
14 |
15 |
16 |
17 | Signals 30 and 31 are _____
18 |
19 | USR1 and USR2 (User-defined)
20 |
21 |
22 |
23 |
24 | Which signal can you send using the _____ command? Any signal!
25 |
26 | kill
27 |
28 |
29 |
30 |
31 | The signal _____ immediately destroys a process. It can't be blocked or caught by the process. Since it is done at kernel level, the process does not even actually receive this signal.
32 |
33 | SIGKILL
34 |
35 |
36 |
37 |
38 | Signal 15 is _____
39 |
40 | SIGTERM (Software termination)
41 |
42 |
43 |
44 |
45 | Signal _____ is SIGTSTP (Keyboard stop)
46 |
47 | 18
48 |
49 |
50 |
51 |
52 | A process is running inside your user terminal. The _____ signal will be sent to it if you press Control+C on your keyboard.
53 |
54 | SIGINT
55 |
56 |
57 |
58 |
59 | Signal 1 is _____
60 |
61 | SIGHUP (Hangup)
62 |
63 |
64 |
65 |
66 | Signal _____ is SIGKILL (Kill)
67 |
68 | 9
69 |
70 |
71 |
72 |
73 | Signal _____ is SIGSTOP (Stop)
74 |
75 | 17
76 |
77 |
78 |
79 |
80 | Signal 18 is _____
81 |
82 | SIGTSTP (Keyboard stop)
83 |
84 |
85 |
86 |
87 | Signal 10 is _____
88 |
89 | SIGBUS (Bus error)
90 |
91 |
92 |
93 |
94 | Can processes communicate via signals? _____
95 |
96 | Yes
97 |
98 |
99 |
100 |
101 | The signal _____ is used as a reset request towards a process.
102 |
103 | SIGHUP
104 |
105 |
106 |
107 |
108 | Signal 3 is _____
109 |
110 | SIGQUIT (Quit)
111 |
112 |
113 |
114 |
115 | A signal is received by a process. If it has one, the process executes a custom _____ for the specific singal. Otherwise, the kernel takes a ____ on its behalf.
116 |
117 | handler routine default action
118 |
119 |
120 |
121 |
122 | Signal _____ is SIGCONT (Continue after stop)
123 |
124 | 19
125 |
126 |
127 |
128 |
129 | A process's received signal and system calls it makes can be displayed with _____
130 |
131 | strace
132 |
133 |
134 |
135 |
136 | When a handler routine is specified for a signal, the signal is referred to as being _____.
137 |
138 | caught
139 |
140 |
141 |
142 |
143 | The signals _____ and 17 (SIGSTOP) can't be caught, blocked or ignored by a receiving process.
144 |
145 | 9 (SIGKILL)
146 |
147 |
148 |
149 |
150 | Signal _____ is SIGHUP (Hangup)
151 |
152 | 1
153 |
154 |
155 |
156 |
157 | Process-level interrupt requests in Linux are called _____
158 |
159 | Signals
160 |
161 |
162 |
163 |
164 | Can a process block a received SIGCONT signal? _____
165 |
166 | No - it can be caught or ignored however
167 |
168 |
169 |
170 |
171 | Can signals be sent to communicate between processes? _____
172 |
173 | Yes
174 |
175 |
176 |
177 |
178 | Signal _____ is SIGBUS (Bus error)
179 |
180 | 10
181 |
182 |
183 |
184 |
185 | The _____ records various information about each process, such as its priority, status, resource usage, opened ports and files, signal mask and address space map.
186 |
187 | kernel
188 |
189 |
190 |
191 |
192 | Signal _____ is SIGINT (Interrupt)
193 |
194 | 2
195 |
196 |
197 |
198 |
199 | The signals 9 (SIGKILL) and _____ can't be caught, blocked or ignored by a receiving process.
200 |
201 | 17 (SIGSTOP)
202 |
203 |
204 |
205 |
206 | You can suspend a process with the _____ signal, then resume it with the CONT signal.
207 |
208 | STOP
209 |
210 |
211 |
212 |
213 | You can suspend a process with the STOP signal, then resume it with the _____ signal.
214 |
215 | CONT
216 |
217 |
218 |
219 |
220 | Can the kernel send signals to a process to inform it of the death of its child process? _____
221 |
222 | Yes
223 |
224 |
225 |
226 |
227 | Signal _____ is SIGQUIT (Quit)
228 |
229 | 3
230 |
231 |
232 |
233 |
234 | Signal _____ is SIGTERM (Software termination)
235 |
236 | 15
237 |
238 |
239 |
240 |
241 | Signal 17 is _____
242 |
243 | SIGSTOP (Stop)
244 |
245 |
246 |
247 |
248 | Signal _____ is SIGSEGV (Segmentation fault)
249 |
250 | 11
251 |
252 |
253 |
254 |
255 | Signal 19 is _____
256 |
257 | SIGCONT (Continue after stop)
258 |
259 |
260 |
261 |
262 | Signal _____ is SIGWINCH (Window changed)
263 |
264 | 28
265 |
266 |
267 |
268 |
269 | Signal 28 is _____
270 |
271 | SIGWINCH (Window changed)
272 |
273 |
274 |
275 |
276 | Signal 9 is _____
277 |
278 | SIGKILL (Kill)
279 |
280 |
281 |
282 |
283 | The kill command ran without any flags sends the _____ signal.
284 |
285 | SIGTERM
286 |
287 |
288 |
289 |
290 | The signals 9 (SIGKILL) and 17 (SIGSTOP) can't be caught, blocked or ignored by a receiving _____.
291 |
292 | process
293 |
294 |
295 |
296 |
297 | The _____ signal suspends the receiving process's execution until a SIGCONT signal is received.
298 |
299 | SIGSTOP
300 |
301 |
302 |
303 |
304 | Signals 10 and 11 (BUS and SEGV) suggest improper usage of _____
305 |
306 | memory
307 |
308 |
309 |
310 |
311 | Signal 2 is _____
312 |
313 | SIGINT (Interrupt)
314 |
315 |
316 |
--------------------------------------------------------------------------------
/docs/syscalls.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | the syscalls for files are open(), close(), read() and _____
4 |
5 | write()
6 |
7 |
8 |
9 |
10 | the _____ syscall adds a directory entry (hard link?)
11 |
12 | link
13 |
14 |
15 |
16 |
17 | the syscall _____ opens/creates a file and returns a file descriptor
18 |
19 | open
20 |
21 |
22 |
23 |
24 | The command _____ traces signals and system calls
25 |
26 | strace
27 |
28 |
29 |
30 |
31 | the syscalls for files are open(), close(), _____ and write()
32 |
33 | read()
34 |
35 |
36 |
37 |
38 | the syscalls for files are open(), _____, read() and write()
39 |
40 | close()
41 |
42 |
43 |
44 |
45 | A signal's _____ must perform a default action, invoke a handler function, block, or ignore it.
46 |
47 | receiving process
48 |
49 |
50 |
51 |
52 | The kernel code and function stubs used by each process are stored within _____
53 |
54 | The address space pages of each process
55 |
56 |
57 |
58 |
59 | each process has 3 user IDs: _____ effective ID (determines privileges) saved ID (set by exec to match the effective ID)
60 |
61 | real ID (the owning user)
62 |
63 |
64 |
65 |
66 | the _____ syscall makes a symbolic link
67 |
68 | symlink
69 |
70 |
71 |
72 |
73 | the syscall _____ releases a file descriptor
74 |
75 | close
76 |
77 |
78 |
79 |
80 | each process has 3 user IDs: real ID (the owning user) effective ID (determines privileges) _____
81 |
82 | saved ID (set by exec to match the effective ID)
83 |
84 |
85 |
86 |
87 | _____ gets/sets default permissions for new files/directories created henceforth by a process.
88 |
89 | umask
90 |
91 |
92 |
93 |
94 | Signals can either be sent by the kernel or _____
95 |
96 | the kill syscall
97 |
98 |
99 |
100 |
101 | How many users can a file or directory be owned by at most? _____
102 |
103 | One
104 |
105 |
106 |
107 |
108 | Can exec can change IDs of files via setuid? _____
109 |
110 | Yes
111 |
112 |
113 |
114 |
115 | the file permission classes are _____, group, other
116 |
117 | user
118 |
119 |
120 |
121 |
122 | each file and directyory in a partition is known by a unique inode _____
123 |
124 | number
125 |
126 |
127 |
128 |
129 | The command strace _____
130 |
131 | traces signals and system calls
132 |
133 |
134 |
135 |
136 | the syscall _____ copies bytes from of memory to a file. Blocks
137 |
138 | write
139 |
140 |
141 |
142 |
143 | _____ expose functionalities of the operating system to programs.
144 |
145 | system calls
146 |
147 |
148 |
149 |
150 | "_____ performs ""memory mapping"" of pages to the process address space. munmap can then be used to unmap them."
151 |
152 | mmap
153 |
154 |
155 |
156 |
157 | A _____ represents one end of a connection as a channel of communication.
158 |
159 | socket
160 |
161 |
162 |
163 |
164 | "mmap performs ""memory mapping"" of pages to the process address space. _____ can then be used to unmap them."
165 |
166 | munmap
167 |
168 |
169 |
170 |
171 | the file permission classes are user, _____, other
172 |
173 | group
174 |
175 |
176 |
177 |
178 | the _____ for files are open(), close(), read() and write()
179 |
180 | syscalls
181 |
182 |
183 |
184 |
185 | _____ changes permissions of an existing file/directory. The invoking process' EUID must be 0, or match the owner of that file/directory.
186 |
187 | chmod
188 |
189 |
190 |
191 |
192 | Signals can either be sent by _____ or the kill syscall
193 |
194 | the kernel
195 |
196 |
197 |
198 |
199 | a partition's root directory always has inode number _____
200 |
201 | 2
202 |
203 |
204 |
205 |
206 | the syscall _____ copies bytes from a file to memory. Blocks.
207 |
208 | read
209 |
210 |
211 |
212 |
213 | each process has 3 user IDs: real ID (the owning user) _____ saved ID (set by exec to match the effective ID)
214 |
215 | effective ID (determines privileges)
216 |
217 |
218 |
219 |
220 | _____ changes the owner of an existing file/directory. The EUID of the invoker must be 0 or the owner of the file/directory.
221 |
222 | chown
223 |
224 |
225 |
226 |
227 | A file is ready to be released/overwritten once its _____'s link count equals 0.
228 |
229 | inode
230 |
231 |
232 |
233 |
234 | the syscalls for files are _____, close(), read() and write()
235 |
236 | open()
237 |
238 |
239 |
240 |
241 | Are syscalls ran inside the kernel? _____
242 |
243 | No - they're only ever called from inside a process. Every process has its own copy of available syscall definitions inside its address space. This avoids making a CPU-expensive context switch to the kernel.
244 |
245 |
246 |
247 |
248 | the file permission classes are user, group, _____
249 |
250 | other
251 |
252 |
253 |
--------------------------------------------------------------------------------
/docs/system.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | The _____ directory contains startup scripts and services.
4 |
5 | /etc/init.d
6 |
7 |
8 |
9 |
10 | The command _____ prints the systemd journal logs for a specific service unit
11 |
12 | journalctl -u [UNIT]
13 |
14 |
15 |
16 |
17 | The command _____ sets an environment variable
18 |
19 | export
20 |
21 |
22 |
23 |
24 | The directory /boot predominantly stores _____
25 |
26 | boot loader static files
27 |
28 |
29 |
30 |
31 | _____ allows Linux not to have to rescrape its own filesystem if it goes down.
32 |
33 | Journalling
34 |
35 |
36 |
37 |
38 | The command _____ prints kernel ring file and driver messages
39 |
40 | dmesg
41 |
42 |
43 |
44 |
45 | The command export _____
46 |
47 | sets an environment variable
48 |
49 |
50 |
51 |
52 | The command _____ prints the current user's environment variables
53 |
54 | env
55 |
56 |
57 |
58 |
59 | The _____ and /etc/grub.conf files contain init process configuration.
60 |
61 | /etc/inittab
62 |
63 |
64 |
65 |
66 | The command env _____
67 |
68 | prints the current user's environment variables
69 |
70 |
71 |
72 |
73 | The directory /var predominantly stores _____
74 |
75 | log files, spool files, variable size files
76 |
77 |
78 |
79 |
80 | The command dmesg _____
81 |
82 | prints kernel ring file and driver messages
83 |
84 |
85 |
86 |
87 | _____ allows Linux to replay its work thus far and complete all incomplete transactions in case of outage.
88 |
89 | Journaling
90 |
91 |
92 |
93 |
94 | The command _____ displays information about the operating system
95 |
96 | uname
97 |
98 |
99 |
100 |
101 | The /etc/inittab and _____ files contain init process configuration.
102 |
103 | /etc/grub.conf
104 |
105 |
106 |
107 |
108 | The command journalctl -u [UNIT] _____
109 |
110 | prints the systemd journal logs for a specific service unit
111 |
112 |
113 |
114 |
115 | The command uname _____
116 |
117 | displays information about the operating system
118 |
119 |
120 |
121 |
122 | The directory /srv predominantly stores _____
123 |
124 | Files saved by running servers and services (like Apache)
125 |
126 |
127 |
--------------------------------------------------------------------------------
/mkdocs.yml:
--------------------------------------------------------------------------------
1 | site_name: Linux FAQ
2 | site_url: https://katademy.github.io/linux-faq
3 | site_author: Icelyn Jennings
4 | site_description: Learn Linux, flashcards, certification, interview questions.
5 |
6 | repo_url: https://github.com/katademy/linux-faq/
7 | repo_name: linux-faq
8 |
9 | theme:
10 | favicon: favicon.png
11 | icon:
12 | logo: material/cloud
13 | custom_dir: overrides
14 | features:
15 | - header.autohide
16 | name: material
17 | palette:
18 | - scheme: default
19 | toggle:
20 | icon: material/toggle-switch-off-outline
21 | name: Switch to dark mode
22 | - scheme: slate
23 | toggle:
24 | icon: material/toggle-switch
25 | name: Switch to light mode
26 |
27 | extra:
28 | social:
29 | - icon: fontawesome/brands/twitter
30 | link: https://twitter.com/katademy
31 | name: katademy on Twitter
32 | - icon: fontawesome/brands/github
33 | link: https://github.com/katademy
34 | name: katademy on GitHub
35 | - icon: fontawesome/brands/linkedin
36 | link: https://www.linkedin.com/company/katademy
37 | name: katademy on LinkedIn
38 | - icon: fontawesome/brands/patreon
39 | link: https://patreon.com/icelynjennings
40 | name: icelynjennings on Patreon
41 | - icon: fontawesome/brands/paypal
42 | link: https://www.paypal.me/icelynjennings
43 | name: icelynjennings on PayPal
44 |
45 | copyright: "© 2020-2021 Icelyn Jennings"
46 |
--------------------------------------------------------------------------------
/overrides/main.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block announce %}
4 | For updates follow @katademy
5 | {% endblock %}
6 |
--------------------------------------------------------------------------------