Linux Flashcards

(202 cards)

1
Q

Vem skrev kerneln för Linux?

A

Linus Torvalds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Vad gör en kernel?

A

It handles the communication between hardware and software. It is the “warehouse” that handles system calls.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Vad kallas “verktygslådan” för grundverktyg?

A

GNU Tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Kernel + GNU Tools + övriga verktyg bildar en?

A

Distribution, t.ex. Ubuntu, Kali och MX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Vilka tre huvuddistributioner utgår de flesta ifrån?

A

Debian, Red Hat och Slackware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Vad kallas den grafiska grunden?

A

X-Windows, X11 eller “X”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Vad står GNU GPL för?

A

GNU General Public License

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Vad är REPL?

A

Read-Eval-Print Loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Vilket är det idag vanligaste skalet och vilket kan komma att ta över?

A

Most common today: Bash

Will most likely take over: z shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Hur många root-kataloger finns det?

A

1, till skillnad från t.ex. Windows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Vad är FHS?

A

File Hierarchy Standard: where we SHOULD place files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Hur når man root som admin? (rootkatalog?)

A

cd /root

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

I vilken katalog finner användaren systemets konfiguration?

A

/etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Hur kommer du som användare till katalogen för loggar?

How do you as a user get to the directory for logs?

A

cd /var/log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Var finns webroot-katalogen?

A

/var/www

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Ta dig till din egen home-katalog:

A

cd /home/användare eller bara cd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Vad finner du i katalogen /dev ?

A

Alias files for hardware devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Vad är syntaxen för kopieringskommandot?

What is the syntax of the copy command?

A

Enter: “cp” followed by “source” then “destination”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Hur många och vilka är standardströmmarna i Linux?

How many and what are the default streams in Linux?

A

3st, Stream0: Standard input, Stream1: Standard output och Stream2: Standard error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Hur gör du för att radera flera filer (exempelvis “fil1”, “fil2, och “fil3”) på en gång?
How do you delete multiple files (such as “file1”, “file2,” and “file3”) at once?

A

Använd: rm fil1 fil2 fil3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Om du använder touch-kommandot på en fil som redan existerar, vad händer då?

A

The contents of the file remain the same, only the time stamp of the file changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Vad innebär termen globbing?

A

Globbing är att använda wildcards.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Vad innebär grep -v ?

A

grip “reverse” - shows lines that do not contain text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Vad är emacs?

A

Emacs is one of the more advanced editors. Most often used by developers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Vilket krypteringssystem använder ssh-nycklar?
RSA
26
Vilket option måste du använda i "wc" för att endast visa antalet ord? Which option do you have to use in the "wc" to display only the number of words?
-w
27
Hur många rader i en fil visar head-kommandot per default?
10 lines
28
Vilket kommando med vilken option är användbart för att följa en loggfil som kontinuerligt uppdateras?
The "tail" command with option "-f"
29
Vad är skillnaden mellan who-kommandot och whoami-kommandot?
who shows all logged in users right now. whoami only shows which user you are currently logged in to.
30
Vad gör en pipe?
Connects one program's stdout to another program's stdin
31
Vad gör följande rad? | cat ~/Testfil | grep e | sort > Sorterad-testfil
Selects rows with the letter e in "Test File" to a new file named "Sorted-Test File".
32
Du har en sträng med mellanslag mellan orden där du vill filtrera ut ett specifikt fält. Vilket kommando är lämpligt i detta fallet?. You have a string with spaces between the words where you want to filter out a specific field. Which command is appropriate in this case?
cut -d ' ' -f, followed by the number of the field you want to filter out.
33
Var hittar du användardatabasen?
In: /etc/passwd
34
Är det lämpligt att alltid vara inloggad som root?
No, you should think about running sudo with your command instead of logging in as root.
35
I vilken ordning listas de tre uppsättningarna av rättigheter för en fil? In what order are the three sets of permissions for a file listed?
"r"ead "w"rite e"x"ecute, "r"ead "w"rite e"x"ecute, rwx.
36
Vad innebär det att sätta write-rättigheter för ugo på en katalog?
You give all users the right to create / delete files in the directory.
37
Vad gör nedanstående rad? chmod 550 filnamn
The line gives the file Read + Execute permissions for user and group, but no permissions for others.
38
Vilket kommando med vilken option ger user, group och others både read + write-rättigheter till filen fil1.txt ?
chmod 666 fil1.txt | chmod ugo+rw fil1.txt
39
Vad är ett alternativt sätt att skriva "chmod 444 filnamn"?
chmod ugo +r
40
Vilket kommando använder du för att modifiera vilken grupp en fil tillhör? (belongs to?)
chgrp groupname filename or chown user: group filename NOTE. sudo required
41
Vilken option använder du med kommandot ls för att lista en fils inode?
ls -i
42
Vad händer om du raderar alla hårda länkar till en inode men behåller mjuka länkar?
The file is deleted. Only hard links lead to an inode. The soft links only refer to a hard link. A soft link does not directly refer to an inode.
43
I filen passwd, vilket fält är användarens ID?
3rd field
44
Vilket uid har root?
0
45
Var är användarnas lösenord lagrade? | Where are users' passwords stored?
/etc/shadow
46
Vilket kopieringskommando använder SSH som bärare? | Which copy command does SSH use as a carrier?
scp (secure copy)
47
Hur refererar du till en variabel?
$VARIABELNAMN/${VARIABELNAMN}
48
Vad är miljövariabler?
Environmental variables are system-wide variables that can be used to change the way the operating system works.
49
Vad innehåller miljövariablen PATH?
PATH contains the absolute paths that the shell uses to search for files in.
50
Vilket kommando kan du använda för att leta upp var i PATH som skalet hittar en fil?
Using the "which" command
51
Vad gör Command substitution?
You replace a variable with stdout from another command. Y = $ (echo "ost") echo $ (date) $ Y = 2020 ... ost
52
Vilken typ av programmeringsspråk är skriptspråket bashscript?
bashscript is an interpretive language, i.e. it can be run on any platform that has bash installed. Disadvantages of this are that it is slower than a compiled programming language.
53
Vad innebär begreppet shebang och hur skrivs en korrekt bash-shebang? What does the term shebang mean and how is a correct bash-shebang written?
Shebang is a line that tells the system which interpreter to use. This is because different programming languages have different syntaxes. ``` A correct bash-shebang is written: #! / bin / bash ```
54
Vad är en exit code och vad används den till?
Exit code is a value (0-255) that a program or script can leave when it quits Exit code is often used to signal to calling programs that, for example, a script "went well or badly".
55
Hur tar du reda på ett nyss avslutat scripts exit code?
Using the variable $?
56
Vad gör kommandot ps?
Gives you an overview of the processes that are active in your system. Tip: With "ps -aux" you can see all the processes that are active.
57
Det finns tre olika sätt att lista kommandon efter varandra. Hur ser dessa ut?
command1; command2; command3 command1 && command2 && command3 command1 || command2 || command3
58
Hur fungerar det när du separerar kommandon med semikolon?
Commands that are separated by a semicolon are run after the previous one, regardless of whether the command before was successful or not.
59
Hur fungerar det när du separerar kommandon med dubbla och-tecken (&&)? (and-lista)
Commands that are separated by double && run after the previous ONLY if the command before was successful (exit code 0). The opposite of using double pipe characters, ||.
60
Hur fungerar det när du separerar kommandon med dubbla pipe-tecken (||)? (or-lista)
Commands separated by double || runs after the previous ONLY if the command before NOT succeeded. The opposite of using double-and-characters, &&.
61
Vilket kommando används för att döda en process med ett specifikt PID (Process ID)?
kill 1234 (där 1234 ersätts med PID-nummer)
62
Beskriv systemd
systemd is a system and service manager. It serves as a replacement for the traditional init process. systemd keeps track of background processes (daemons) and handles logging. Modern variant of "service".
63
Vilket tecken kan du använda för att starta ett kommando i bakgrunden och direkt återgå till prompten.
&
64
Vilken är den vanligaste pakethanteraren för RedHat-baserade linux distributioner? What is the most common package manager for RedHat-based linux distributions?
Yum
65
Hur gör du för att avinstallera ett paket i ubuntu?
Command: apt remove package name
66
Vad betyder följande: apt-cache search paketnamn?
You search the local cache of available packages. To update it, use "apt update".
67
Hur gör du när du vill redirecta output direkt till linux "papperskorg"?
Redirect to / dev / null.
68
Vad innebär Local Port Forwarding?
The connection from a local SSH client is forwarded via a local SSH server to the destination server.
69
Vad innebär Dynamic Port Forwarding?
The connection from programs is forwarded via a local SSH client to a local SSH server. Then on to one or more destination servers.
70
Vad är syntaxen för local port forwarding?
ssh -L port1:remoteip:port2 user@host
71
Beskriv skillnaden mellan lossy och lossless-komprimering
Lossy does not allow you to recreate a file in its full form, as some data is deleted to save space. (Often used for audio and video) Lossless allows you to completely recover a file, without losing data. (Is less efficient when it comes to saving space)
72
Förklara följande kommando: tar -xf fil.tar
tar (tape archive) is used in this case to extract the uncompressed tar archive in the current directory.
73
Vilket kommando med vilken option används för att skapa ett komprimerat tar-arkiv med namnet file.tar?
tar -czf fil.tar * do not forget -z, the option for the compression itself
74
Vad är fördelen med att använda rsync vid backuper över internet jämfört med exempelvis scp?
rsync does not transfer files that are already at the destination, i.e. saves bandwidth. This enables differential backup.
75
Vad är skillnaden mellan inkrementell kontra differentiell backup?
A differential backup backs up all files that have been modified on a system since the last time a FULL backup was performed. An incremental backup backs up all files that have changed on a system since the last time a backup was run. The latest backup can be of ANY type.
76
Du skriver in rsync -avz, vad betyder optionerna?
- a means that the transfer must take place recursively, with timestamps and rights preserved. - v means that the file being transferred is displayed and sums up when the transfer is complete. - z compresses the files being transferred, which facilitates slow internet connection.
77
Du överför filer med rsync, men du får ingen information om överföringen lyckades. Varför? You are uploading files using rsync, but you will not get any information if the transfer was successful. Why?
rsync works by default in the background. You must use option -v (verbose) to get information about which files are being transferred and a summary when the transfer is complete.
78
Bibehåller rsync -a hårda länkar vid överföring? | Does rsync -a retain hard links during transmission?
No, you must use the -H option to maintain hard links after a transfer.
79
Vad är en daemon?
A program that works in the background with a service instead of under the direct control of the user.
80
Hur gör du för att söka i kataloger + underkataloger med hjälp av ls kommandot?
ls -lR | Hint: combine this with "grabbed filename" to search for a specific file
81
Varför är kommandot locate så snabbt på att söka igenom systemet?
This is because locate uses a complete indexing of the system in a database. To update this database use: updatedb.
82
Var finner du konfigurationsfilen för cron och hur redigerar du den?
In: / etc / crontab Editing is done with crontab -e
83
Vad innebär respektive fält separerat av mellanslag i crontabfilen?
Minute Hour Day Month Weekday
84
Hur ofta kontrollerar crond crontab-filen?
En gång varje minut. (Once every minute.)
85
Vad innebär följande i en crontab-fil? 0 0 * * * *
Run once every day at midnight.
86
Vad innebär följande i en crontab-fil? 1-59/2 * 3-6 * *
Run once every two minutes on the 3-6th day of each month.
87
Vad innebär följande i en crontab-fil? 0 0 * 7-8 1-5
Run once at midnight every Monday to Friday in July and August.
88
Vad har dessa fem filer gemensamt? syslogd, telnetd, pptpd, inetd, bootlogd
They are all daemons. I.e. that they run silently in the background.
89
Kommer ordet "Jimmy" skrivas ut på skärmen? ``` #!/bin/bash MITTNUMMER=100 if [ $MITTNUMMER -eq 200 ] then echo "Jimmy" fi ```
No! Since the number 200 is not equal to 100, "Jimmy" will not be printed on the screen.
90
Vilken option behöver du till file-kommandot för att leta efter filer som skapats de senaste 15 minuterna?
-mmin 15
91
Vilken option behöver du till file-kommandot för att leta efter filer som använts de senaste 40 minuterna?
-amin 40
92
Vad gör följande kommando? find FILNAMN -mtime -30
Searching for files that have been modified in the last 30 days. (Hint: To search for files modified MORE than 30 days ago, use +30 instead.)
93
Vad gör följande kommando? find . -size -1G
Looking for files in the current directory and subdirectories that are less than 1 GB in size.
94
Hur använder du find-kommandot för att hitta filer med en specifik filrättighet?
Use the "-perm xxx" option, where xxx is replaced with the right.
95
Vad gör optionen -exec i find-kommandot?
Allows you to run a command on the file you are looking for. For example, useful for searching for a script and then running it directly.
96
Hur skapar du ett nytt alias i bash?
alias alias name = command is used to create a new alias. For example: alias l = "ls -la"
97
Var kan du spara ett alias för att göra det permanent?
I ~ / .profile. ????preguntar! or ~ / .bashrc or ~ / .bash_aliases
98
Vad ska du skriva för att lista storleken på alla filer, rekursivt från där du står, i mänskligt läsbart format? What should you write to list the size of all files, recursively from where you stand, in human readable format?
du -h
99
Vad gör df -h?
Displays used and free file space per file system in readable format.
100
Vad heter den första hårddisken på ett system?
/dev/sda
101
Vad gör lsblk?
Lists system disks.
102
Hur många rootpartitioner går det att ha i ett system?
Always just one. Other partitions are mounted under the root partition.
103
Är det möjligt att mounta partitioner som vanlig användare?
No, only root can mount partitions. For example, some distributions automatically mount USB devices as root.
104
Vilket filsystem är standard på ett nytt linuxsystem?
Ext4
105
Vad använder systemet en swappartition till?
It is used by kernel as virtual memory if RAM runs out.
106
Vilket program kan användas för att partionera en ny disk?
fdisk eller cfdisk, cgdisk, gparted, gdisk osv
107
Vad betyder följande? mkfs -t /dev/sdb1
Partition the disk sdb1 with the system's default file format.
108
Hur fungerar umask?
umask automatically removes directory and file permissions from the default settings (666 for files) (777 for directories) to create actual permissions.
109
Var sätts default umask i ubuntu?
In: /etc/login.defs
110
Hur gör du för att modifiera execute-rättigheter på en fil med umask?
You do not. umask cannot change the permissions on a file.
111
Vilken umask ger rw-r--r-- ? (När det gäller en fil)
022 | 666 - 022 = 644
112
Vilka rättigheter tar umasken 222 bort på en fil?
All write permissions on a file. | 666 - 222 = 444 r - r - r--
113
Vilka rättigheter tar umasken 666 bort på en katalog?
All but execute permissions. (777 - 666 = 111) --x - x - x
114
Vad står PAM för?
Pluggable Authentication Module | A modular authentication system
115
Vad hittar du i /etc/security/pwquality.conf?
A file to configure the default password quality for system passwords. This file is read by the libpwquality library and the tools that use this library to control and generate passwords.
116
Vad gör denna rad? tr [a-z] [A-Z]
Translates lowercase letters into uppercase using tr (translate).
117
Vad är awk?
A word processor with its own programming language and syntax.
118
Förklara hur du med sed (Stream EDitor) ändrar i denna textfil: sed 's/unix/linux/' linus.txt
You replace the first word in a line beginning with "unix" with "linux" in the file "linus.txt". To replace all words (not just the first), use 's / unix / linux / g'
119
Hur gör du för att endast skriva ut rad nummer 7 i en fil med sed?
sed -n 7p
120
Vilket kommando används för att temporärt logga in som root?
su
121
Vilket kommando ska användas för att editera /etc/sudoers?
visudo
122
Hur fungerar denna syntaxen i /etc/sudoers? root ALL=(ALL) ALL
the root user can be activated from all terminals, act as all users, and execute all commands.
123
Vad har jimmy rättigheter till att göra här? jimmy ALL=(ALL)
Jimmy can log in from all terminals and act as root, but only using the sudo command
124
Vad har jimmy rättigheter till att göra här? jimmy ALL= /sbin/poweroff
Jimmy has the right, from all terminals, to run a specific command. In this case, poweroff.
125
Hur ser syntaxen ut för /etc/sudoers?
user host = (user(s)) command
126
Vad är NFS?
Network File System. | A protocol for sharing files and directories with clients over a network.
127
Vad gör detta kommando? exportfs -r
The NFS server reads the changes you made in the configuration file.
128
Var hittar du filen som styr vilka ip-adresser som har tillgång till en nfs-server?
In: /etc/exports
129
Vilken regex skriver du för att matcha följande rader? Match: $t.xw Skip: 3z45 Match: w.345
\. | Without a backslash, a point matches all characters.
130
Vilken regex skriver du för att matcha följande rader? Match can Match man Skip dan Skip pan
Either '[cm] an' or '[^ dp] an'
131
Vilken regex skriver du för att sortera ut ord där bokstaven "o" förekommer EXAKT tre gånger i rad?
o{3}
132
Vilken regex skriver du för att sortera ut ord där bokstaven "f" förekommer flera gånger i rad?
[f]+
133
Vad betyder denna regex? \d
Optional number.
134
Vad betyder denna regex? | ^
Matches the beginning of the line
135
Hur ska du skriva en regex för att matcha en tom rad?
^\s*$
136
Hur gör du för att matcha ett mellanslag?
\ s {1} = Matches 1 whitespace. | '' = Also works.
137
Vilken regex skriver du för att matcha rad 1, men inte rad 2? 1. Jimmy - Linuxexpert 2. Jimmy - Linuxexpert & Ciscoexpert
Jimmy - Linuxexpert$
138
Nämn två kommandon med optioner som möjliggör det att sätta ett expiration date på ett användarkonto.
usermod -e 2020-xx-xx users chage -E 2020-xx-xx users
139
Vad gör kommandot chage?
Manages periodic password changes and time limitation of user accounts.
140
Vad får du fram för information här? chage -l jimmy
Information about time limits for passwords and access to the "jimmy" account.
141
Vad står HIDS för?
Host Intrusion Detection System
142
Vilket program kan användas till att skydda mot brute-force attacker?
fail2ban
143
Vilken av följande filer ska användas för att konfigurera fail2ban? 1. /etc/fail2ban/jail.conf 2. /etc/fail2ban/jail.local 3. /etc/fail2ban/jail.d/f2bconf.local
2. /etc/fail2ban/jail.local
144
I filen /etc/fail2ban/jail.local, vad innebär det att maxretry är ställt till värdet 3?
This means that the person trying to log in has three attempts within findtime before the person is banned.
145
Fail2ban använder sig av så kallade "jails" Vad är ett jail?
A jail describes a service and contains filters and actions. Log degrees that match the search pattern are counted and when a predefined condition is met, corresponding measures are performed.
146
Vad är systemctl?
A command to manage systemd. Used to, for example, start / restart / shut down services (daemons) or to see the status of a service.
147
Vad betyder IPS?
Intrusion Prevention System
148
På vilket sätt fungerar fail2ban även som ett Intrusion Prevention System?
fail2ban can apply iptables rules.
149
ufw är frontend för iptables. Vad gör programmet?
UFW (Uncomplicated Firewall) is a program for managing a net filter firewall that is designed to be easy to use. UFW uses iptables for configuration and is standard in ubuntu.
150
Hur många tabeller finns det default i iptables?
3 pieces: MANGLE, FILTER and NAT
151
I iptables, vad konfigureras i tabellen MANGLE?
MANGLE handles QoS (Quality of Service), for example how traffic should be prioritized.
152
Vad heter tabellen i iptables som hanterar trafikfiltering?
FILTER
153
NAT-tabellen i iptables har två stycken "chains". Vad heter dessa och vad hanterar respektive chain?
Prerouting and Postrouting. Prerouting handles traffic where the destination address is translated. Post-routing handles traffic where the source address is translated.
154
FILTER tabellen i iptables har 3 st chains. Vilka är dessa?
INPUT - Traffic to the Linux device. FORWARD - Traffic passing THROUGH the Linux device (routing). OUTPUT - Traffic coming from the Linux device
155
Detta kommando listar aktuell iptables-konfiguration:
(sudo) iptables -L
156
Vad är defaultinställningen i en iptables-kedja?
policy ACCEPT (In cisco terms "permit any")
157
Vad betyder följande rad? | iptables -A INPUT -p icmp -j DROP
Traffic to the device belonging to the icmp protocol should not be allowed and dropped without response to the transmitter.
158
Här droppas tcp-trafik på port 22 från 10.0.0.123/24. Hur gör du för att lägga till detta i loggen? iptables -A INPUT -p tcp --dport 22 -s 10.0.0.123/24 -j DROP
You add "-j LOG" after the ip address on the line before. Example: iptables -A INPUT -p tcp --dport 22 -s 10.0.0.3/32 -j LOG iptables -A INPUT -p tcp --dport 22 -s 10.0.0.123/24 -j DROP
159
Vad gör "-j RESET" i slutet av en rad i iptables?
DOES NOT allow traffic, but responds to the sender with an icmp stating that traffic is not allowed.
160
Vilken jump action vill du ha i slutet av en rad i en iptables-kedja för att tillåta trafiken?
ACCEPT
161
Vad är extended file attributes?
Extended file attributes are file system functions that allow users to associate computer files with metadata that is not interpreted by the file system, while common attributes have a purpose that is strictly defined by the file system.
162
Vad gör kommandot lsattr?
Lists extended file attributes.
163
Vilken kommando används för att ändra extended file attributes?
chattr
164
Vad innebär kommandot "chattr +a filnamn" ?
The file is given the attribute "append". That is, it will only be possible to add information to the file, never delete data in the file.
165
Vad innebär kommandot "chattr +i filnamn" ?
The file is given the attribute "immutable". That is, it is not possible to delete, add, change, move the file, etc. In other words, the file is frozen and unchanged where it is.
166
Är det möjligt att redigera extended file attributes på filer i ett exfat eller fat32-filsystem?
No, only specific file systems support extended attributes. For example NTFS, APFS and ext4.
167
Vad är skillnaden mellan dessa två rader? - rwSrw-r-- - rwsrw-r--
The top line does not have execute rights for the user, but has special permission. On the bottom line there are execute rights AND special leave.
168
Vad innebär SUID (Set User ID)?
SUID is a special state assigned to a file. These permissions allow the file being run to run with the owner's permission. If a file was owned by the root user and has the setuid bit set (regardless of who ran the file), it would always run with root user permissions.
169
Hur sätter du SUID (Set Group ID) på en fil?
With "chmod u + s" or "chmod 4000"
170
Hur fungerar det när SGID (Set Group ID) är tilldelat en fil?
When Set Group ID is assigned, it is run with the group permission. For example, if a file was owned by the user group, it would always run with the permission of the user group, regardless of who ran the file.
171
Hur använder du chmod för att sätta SGID (Set Group ID) på en fil?
chmod g+s eller chmod 2000
172
Hur fungerar SGID för kataloger?
När setgid-biten är inställd på en katalog ärver alla filer som skapas i katalogen gruppägarskapet för den katalogen.
173
Vad är sticky bit på en katalog?
When sticky is set to a directory, only the root user, the directory owner and the file owner can delete files in that directory.
174
Hur sätter du endast sticky på en katalog med chmod?
chmod o+t eller chmod 1000
175
Du ska använda chmod för att sätta följande rättigheter med oktala systemet på filen "jimmytext": Read för User,Group,Others Sticky. Vad skriver du in?
chmod 1444 jimmytext
176
Du ska använda chmod för att sätta följande rättigheter med oktala systemet på filen "jimmytext": Read för User,Group,Others. Write för User och Group. SUID Vad skriver du in?
chmod 4664 jimmytext
177
Vad är auditd?
A monitoring service for Linux that can be used to log system calls, file changes, etc.
178
Hur bygger du en databas över systemet i tripwire?
tripwire --init
179
Hur gör du för att kontrollera systemet i tripwire utifrån din databas?
tripwire --check
180
Detta program är är ett verktyg för integritetscheck av filsystem.
Tripwire
181
Beskriv hur tripwire fungerar kortfattat.
Tripwire uses a policy and a database. The policy is the configuration files that define which files and directories are to be monitored and how. The database is built based on what the system's files look like at a given time. When an integrity check is run, the files in the system are compared with what they looked like before according to the database.
182
Du vill konfigurera så att alla systemhändelser loggas till en remote syslog-server. Vilken fil ska du ändra i?
/etc/rsyslog.conf
183
Vad används Syslog-protokollet till?
The syslog protocol is used to log system events.
184
Var hittar du alla sysloghändelser?
I /var/log/syslog.
185
Är det säkert att skicka syslog-data till ett annat nät?
No, not without further action. syslog is unencrypted.
186
Hur många severity-levels finns det i syslog?
8 stycken. 0 - 7.
187
Vilken är den allvarligaste severity-leveln i syslog?
Level 0, Emergencies.
188
Vad är innebär facility i syslog?
Service identifiers, i.e. which part of the system is the sender.
189
Vad heter kernelfunktionen som möjliggör användandet av iptables? (obs, små bokstäver!) What is the name of the kernel function that enables the use of iptables? (note, lowercase letters!)
netfilter
190
script2 körs bara om script1 avslutas med exitlevel 0
script1 && script2
191
komando 'script.sh 1>fil' skickar scriptets standar error till fil
Nej
192
echo "ej" >fil; In fil fil1; In fil fil2;cat fil1 fil2; #Vad kommer att skrivas ut på skärmen?
hejhej
193
Vems lösenord ska anges här? Nisse Kör kommandot su - | Whose password should be entered here? Nisse Run the command su -
root's password
194
Det finns en enda fil på Bettan som ägs av användaren "games". Vilken är filen? Svara med absolut sökväg There is only one file on Bettan that is owned by the user "games". What is the file? Answer with absolute path
cecilia@bettan:~$ find / -user games 2> /dev/null or cecilia@bettan:~$find / -user 5 2> /dev/null /var/lib/php/modules/justafile
195
Vilket är tredje ordet på rad 901 i filen /home/jimmy/hhgttg.txt?
cecilia@bettan:/home/jimmy$ cat hhgttg.txt | head -901 | The correct answer is: phrase
196
Vems lösenord ska anges här? Nisse kör kommandot sudo passwd | Whose password should be entered here? Nisse runs the command sudo passwd
Nisse's
197
Du vill lista filers extended attribut. Vilket kommandon använder du? (obs bara kommandot. Inga optioner/parametrar) You want to list files extended attributes. What commands do you use? (note only the command. No options / parameters)
lsattr
198
Hur mycket ledigt utrymme finns på Bettans /-partition? Svara med antalet jämna Gigabytes. How much free space is there on the Bettans / partition? Answer by the number of even Gigabytes.
cecilia@bettan:~$ df -h | 15 gb
199
Det finns enda fil på Bettan som har rättigheter | "-r-x-wx-w-" (output från ls -l). Vad heter filen? Absolut sökväg!
cecilia@bettan:~$ find / -perm 532 2> /dev/null | /Correct answer: usr/share/mime/README
200
På Bettan, vad heter gruppen med gid 1043?
cecilia@bettan:~$ cat /etc/group | grep 1043 | Correct answer: newgroup2
201
På Bettan, i filen /home/jimmy/hhgttg.txt, hur många rader finns det som innehåller antingen "think" eller "thank"?
cecilia@bettan:~$ cat /home/jimmy/hhgttg.txt | grep "th[ia]nk" | wc -l Correct answer: 100
202
På Bettan, i filen /etc/ssh/ssh_config, hur många rader finns det i filen om du inte räknar med tomrader och kommentarer?
cecilia@bettan:~$ cat /etc/ssh/sshd_config | grep -v '^#' | grep -v '^$' | wc -l Correct answer was 32