Zero to Hero Flashcards

1
Q

List out all files in a directory that aren’t all shown in standard ls

A

ls -la

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

Copies file into new directory

A

cp new.txt Desktop/new.txt

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

move file into new directory

A

mv new.txt Desktop/new.txt

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

locate a file

A

updatedb (to update the command)
locate new.txt

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

What does this mean?
-rw-r–r–

A

File owner: read and write
Group Owner: read
All other permissions: read

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

What does {chmod +x new.txt} do?

A

It gives all user levels executable permission
-rw-r–r–
—>
-rwxr-xr-x

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

How can I add a user

A

adduser bob

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

how to see all users on the machine?

A

cat /etc/passwd/

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

How to see the hash for each user

A

cat /etc/shadow/

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

How can I switch users on the machine at the CLI?

A

su bob

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

How can I switch back to root user?

A

su -

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

How to view recent activity via CLI

A

cat auth.log

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

How can I print out my information

A

ifconfig

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

How can I limit a ping to 1 packet

A

ping -c 1 {IP address}

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

what does arp -a do?

A

It associates IP addresses with MAC addresses

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

What does netstat -ano do?

A

Shows you all the ports that are open and what is connected to those ports

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

What does route do?

A

??

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

How do you check the history of all commands you have run?

A

history

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

How can you check the previous times you have run the ping command?

A

history | grep ping

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

How would you write the following text “hello world” into a new file named newFile.txt?

A

echo “hello world” > newFile.txt

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

How can you add more text to a file without overwriting the existing text?

A

echo “hello world again”&raquo_space; newFile.txt

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

what does the {touch} command do?

A

Allows you to create a new file i.e. touch hello.txt

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

How could you get rid of a program i.e. impacket?

A

apt purge impacket

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

How could you find your IP address?

A

ifconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you start a service?
service apache2 start service ssh start service postgresql start
26
How do you configure your services to start automatically when rebooting your computer?
systemctl enable ssh systemctl enable postgresql
27
How do you configure your services to start automatically when rebooting your computer?
systemctl enable ssh systemctl enable postgresql
28
How could you write the information from a single packet ping into a new text file?
ping -c 1 {IP address} > ip.txt
29
From this: PING 192.168.1.254 56(8) bytes of data. 64 bytes from 192.168.1.254: icmp_sequ=1 ttl=128 time=0.594 How can you extract out the IP address?
ping -c -1 192.168.1.254 | grep "64 bytes" | cut -d " " -f 4 | tr -d ":"
30
How could you loop through a list of IP addresses that are up on a network and run nmap on each of them?
for ip in $(cat iplist.txt); nmap -p 80 -F4 $ip & done
31
What are the five stages of hacking?
1. Reconnaissance (passive and active) 2. Scanning and enumeration 3. Gaining access 4. Maintaining access 6. Covering tracks
32
List the components of passive recon for web/host
Target validation - WHOIS, nslookup, dnsrecon Finding subdomains - Google fu, fig, nmap, sublist3r, bluto, crt.sh Fingerprinting - nmap, Wappalyzer, WhatWeb, BuiltWith, Netcat Data breaches - HaveIBeenPwned
32
What are some ls flags and what do they do?
-l = lists out long format -a = lists out all file including hidden files
33
What does theharvester do and what cli do you use?
It finds emails, subdomains and hostname IPs with the given domain name theharvester -d telsa.com -l 500 -b google
34
What does bluto do and what cli do you use?
It looks through haveIpwned information, it does active DNS recon (zone transfers) and brute force attacks bluto ->target Domain: tesla.com
35
What website can you use to search for subdomains via certificates?
crt.sh
36
Should you scan TCP, UDP or both?
mostly TCP, but should do both
37
What types of applications use UDP? and why?
DNS, DHCP, SNMP. Don't need reliability, just fast connection
38
What is the process of a TCP connection?
Three way handshake SYN -> <- SYN, ACK ACK ->
39
How does stealth scanning work?
-> SYN <- SYN ACK -> RST
40
What does the -T4 flag do?
It represents speed T1 - T5 on nmap
41
How many ports are by default scanned using nmap? Is the default number good or bad? Why?
'Top 1000' Its better to scan more than the default as you may miss some with open connections
42
What does the -A flag enable in nmap scan?
It enables OS detection, version detection, script scanning and traceroute It basically means 'intense'
43
what does -p- flag do in nmap?
It makes the nmap scan all ports
44
Explain the concept of staging with nmap.
First, scan all ports to see which are open. nmap T4 -p- {IP Address} THEN, scan the ports that are open more intensely. nmap T4 -p53, 404, 80, 111 {IP Address} This avoids unnecessarily intensely scanning all unopened ports.
45
What kind of output does -oA give you with nmap?
normal, XML, s|
46
How would you check was rwx right each file has
use ls -l or ls -a
47
how do you change your password?
passwd
48
If you have a command in mind, but don't know exactly what it is, how can you figure it out using the cli?
apropose copy
49
How do you find out who is logged into your system?
w or who
50
What does TTY mean and where can you find it?
TTY = teletype and stands for user sessions You can find it using command w
51
How do you find the kernal version and name
uname
52
what does the uptime command do?
Tells you how long the machine has been up, the number of users sessions and average load
53
How do you find every log in and reboot that has happened in the system
last
54
How can you find the total storage left in the linux system?
df -h (h = human-readable)
55
Imagine you need to connect to one of your machines, somewhere in the cloud. How would you go about connecting to that machine securely and getting a shell on it?
Is there a VPN to connect to first? SSH is standard tool to connect to remote host? What does the SSH command look like? How would you authenticate? password/key? Don't want root login enabled
56
what directory am i in?
pwd
57
how to copy text into an existing file?
echo "G'day" > file.txt
58
How to copy a file into another directory?
cp {filename} {path} i.e. cp file.txt /test/putHere
59
How would you copy a file from the remote host to another remote host or the work laptop you are currently using?
rsync root@{IP address}:/root/myfile.txt
60
Say we are on a box that is running Ubuntu, how would you manage services on this box?
systemctl start nginx systemctl status nginx curl localhost (check access) systemctl stop
61
What is the difference between starting a service and enabling it?
Starting = just starts it for that session Enabling = starts automatically upon each boot up
62
How would you see what all the files in var/log are taking up space?
du -sh var/log/*
63
how to find IP address of the eth0 interface
ip addr show
64
What is your default route?
ip route show
65
What is an init system?
init is the first real process that the kernel starts init is responsible for starting all of the services, units that you expect to have running init is responsible for reparenting orphaned processes
66
What is a linux user made of?
It is an entry in a few different text file etc/group, etc/shadow, etc/passwd
67
What is the shell?
Program that takes your commands and sends them to the operating system. These are launched by the Terminal.
68
How do you create a file called myfile?
touch myfile
69
What command can you use to find the file type of a file?
file
70
How can you read the contents of two files, file1 and file2 combined together?
cat file1 file 2
71
How do you quit out of a less command?
q
72
How do you copy myfile into another directory while making sure to notify yourself if there is a file in that directory with another name?
cp -i myfile /home/pictures
73
How do you copy over all files that have the extension .jpg into another file?
cp *.jpg home/pictures
74
How do you copy over a directory into another directory?
cp -r directorytoCopy home/directorycopyto
75
how do you move two files into another directory?
mv file1 file2 /home/..
76
How do you rename a file or directory?
mv oldfile newfile mv olddir newdir
77
how do you make a backup of a folder when moving it?
mv -b dire1 dire2
78
How do you make subdirectories when making a new directory?
mkdir -p books/hemmingway/favourites
79
how do you remove a file and how do you remove a directory?
rm file rmdir directory
80
What protection level must a file have to restrict from straight out removing? and how can you overcome the restriction?
Write-protected you can overcome it by using the -f flag for force i.e. rm -f file
81
How do you find a file in your home folder called puppies.jpg?
find /home -name puppies.jpg
82
How do you search for a folder called MyFolder in your home directory? You only want to search for directories. How can you do this?
find /home -type d -name Myfolder
83
What are the 4 main ways you can find information about a command?
pwd --help help pwd whatis man
84
How do you set an alias for command?
alias foobar='ls -la' Note, this wont be saved after reboot
85
How do you exit from the shell?
exit or logout
86
how to append this text: "sample text" to a file named 'Mate.txt'?
echo sample text >> Mate.txt
87
How would you redirect an ls call to be printed into a text file?
ls var/log > output.txt
88
How would you create an empty file?
> someFile.txt or touch someFile.txt
89
how would you read in from one file and paste it into another new file?
cat file1.txt > file2.txt
90
What are streams?
I/O streams are things like stdin, stdout and stderr They can be called using file descriptors: 0 = stdin 1 = stdout 2 = stderror
91
How would you send a stderror to a file?
ls fake/directory 2> peanuts.txt
92
How would you direct both stdout and stderr to a file?
ls fake/directory &> peanuts.txt
93
How would you redirect stderror outputs to a special file call?
ls fake/directory 2> /dev/null
94
How can you see all items in a directory AND stdout it into a file?
ls | tee peanuts.txt
95
How do find the path to your home directory?
echo $HOME
96
How do you see your username?
echo $USER
97
Where do things like $HOME and $USER come from?
environment variables (env)
98
I have some text in a text file test.txt: hello world; test I want to cut out and present the part after ';'. how do I do it?
cut -f 2 -d ';' test.txt
99
how do you paste content?
paste -d ' ' -s sample2.txt
100
how do you just display the first, say 20 lines of a cat?
head -n 20 /var/log/syslog
101
What is the default number of lines shown by the head command?
10
102
How do you just display the last, say 20 last lines of cat?
tail -n 20 /var/log/syslog
103
What does the following command do? $ tail -f /var/log/syslog
It follows the file such that you can see everything that is getting added to that file
104
How do you join two files by field?
The two files must be ordered i.e. 1 Zac 2 Jack 3 Mack Simunovic 1 Thackrey 2 James 3 Then do: join -1 2 -2 1 text1.txt text2.txt
105
How do you sort text in a file? How do you reverse sort? How do you sort via numerical value?
sort file.txt sort -r file.txt sort -n file.txt
106
How do you translate from lower case to upper case?
tr a-z A-Z hello
107
How can you remove duplicates from a text file?
unique text.txt
108
How do you get the number of occurances of a line?
unique -c text.txt
109
How do you return unique values?
uniq -u text.txt
110
How do you return duplicate values?
uniq -d text.txt
111
How would you overcome the limitation of uniq not picking up non-adjacent duplicates?
sort text.txt | uniq
112
How do you get the word count of a line?
wc
113
What does grep do
Is searches through text and returns matches
114
How can you use grep case insensitively?
grep -i hello helloWorld.txt
115
How would you use grep to search for all files in a directory with a .txt ending?
ls /directory | grep '.txt$'
116
Where can you find the UID for users?
cat /etc/passwd
117
What does each of these fields mean? root:x:0:0:root:/root:/bin/bash
root = username x = user's password (stored in /etc/shadow) 0 = UID 0 = Group ID root = GECOS field (comments about user) /root = user's home directory /bin/bash = user's shell
118
Where could you find this sort of information? root:MyEPTEa$6Nonsense:15000:0:99999:7:::
sudo cat /etc/shadow
119
what do each of these fields stand for? root:MyEPTEa$6Nonsense:15000:0:99999:7:::
1. Username 2. Encrypted password 3. Date of last password changed (expressed as number of days since jan 1 1970) 4. Minimum password age i.e. number of days a user has to change their password 5. Max password age 6. password warning period 7. password inactivity period 8. account expiration date
120
What is /etc/group for?
Used for user management, that is, different groups with different permissions
121
in /etc/group, what do these fields stand for? root:*:0:pete
1. Group name 2. group password. Note, * = default value 3. Group ID 4. List of users
122
how do you add users?
sudo useradd bob
123
how do you remove users?
sudo userdel bob
124
How do you change password for a user
passwd bob
125
explain this: drwxr-x-r-x
d = directory rwx = user permissions include read, write, executable r-x = group permissions include read and executable r-x = other permissions include read and executable
126
how can you add user executable permissions to a file?
chmod u+x myfile
127
How do you remove user executable permissions to a file?
chmod u-x myfile
128
How do you add write permissions for user and groups?
chmod ug+w
129
what are the numeric representations for read, write, executable?
read = 4 write = 2 executable = 1
130
What does: chmod 755 myfile do?
7 = 4 + 2 + 1, so user has rwx 5 = 4 + 1, so groups have r-x 5 = 4 + 1, so other users have r-x
131
how do you modify the user ownership of a file?
sudo chown zac myfile
132
How do you modify the group ownership of a file?
sudo chgrp imogen myfile
133
How do you modify both user and group ownership at the same time?
sudo chown zac:imogen myfile
134
How do you reset permission back to default?
unmask 022 This sets the following: user = wrx group = -rx others = -rx
135
What allows a user to run a program as the owner of the program file rather than as themselves?
Set User ID (SUID) -rws When this permission is set, it allows the users who launched the program to get the file owner's permission as well as execution permission.
136
How do you modify the SUID permission?
sudo chmod u+s myfile of sudo chmod 4755 myfile
137
How do you modify the SGID?
sudo chmod g+s myfile or sudo chmod 2555 myfile
138
What are the three process permissions?
1. effective user ID = ID of the user that is normally the owner 2. Real user ID = ID of the user that launched the process 3. Saved User ID = Temporary switching from privileged to non-privileged permissions and the elevated user id is waved to SUID so that it can be used for switching back to privileged account
139
What is the sticky bit? and what is it defined as in the permissions?
It is a permission bit that sticks to a file/directory such that only the owner or root can delete or modify the file. rwxt
140
How do you modify the sticky bit?
sudo chmod +t mydir or sudo chmod 1755 mydir
141
What are processes and what manages them?
the programs running on your machine. More specifically its where the system allocates memory, CPU, I/O to make the program run. They are managed by the kernel.
142
How do you see what processes are running on your machine?
ps
143
What can you see when you run ps?
PID = process id TTY = Controlling terminal asociated with the process STAT = Process status code TIME = total CPU usage time CMD = Name of executable / command
144
What can you see when you run ps?
PID = process id TTY = Controlling terminal asociated with the process STAT = Process status code TIME = total CPU usage time CMD = Name of executable / command
145
what does ps aux do?
Show info on a = all processes running inc. those run by others u = shows more details about the process x = lists all processes that don't have a TTY associated with it
146
What are the fields that you can see in ps aux?
USER: Effective user PID %CPU = CPU time used divided by the time the process has been running %MEM = Ratio of the process's resident set size to the physical memory on the machine VSZ = Virtual memory usage RSS = Resident Set Size, the non-swapped physical memory that the task has used et al
147
How can you get real time information about the processes running on your system?
top
148
What is the difference between a terminal device and a psuedoterminal device?
terminal device is a native hardware device running directly on a console a psuedoterminal is a software emulation of a terminal - this is the terminal you are used to working in.
149
What is in charge of processes and how does it work?
Kernel is in charge of processes When a program is run, the kernel loads up the code of the program in memory, determines and allocates resources and then keeps tabs on each process.
150
What does the kernel know about a process?
1. Status 2. The resources the process is using and receives 3. Process owner 4. Signal handling
151
How is a new process created?
An existing process clones itself using the fork system call, creating a mostly identical child process. The child process takes on a new ID (PID) and the parent, the PPID the execve system call is then called to launch a new program on that process.
152
What is the init process?
It is like the parent of all processes, which is created by the kernel upon boot up, and assigned a PID of 1. It is given root privileges and runs many processes that keep the system running. can only be terminated when system shuts down.
153
How do you terminate a process?
use the _exit system call. This will free up the resources that process was using.
154
What does a termination status 0 mean?
It lets the kernel know that the process succeeded.
155
Why is it not enough to simply _exit system call a process?
Because the parent process must first acknowledge the termination of the child process by using the wait system call to check termination.
156
What happens when a parent process ends before a child process?
They become orphan processes and placed under the care of init, until init calls the wait system call.
157
What happens when a child terminates and the parent process hasn't called wait yet?
The kernel turns the child process into a zombie process. The resources are freed up, but the zombie process is still present on the process table.
158
Why is it bad if there are many zombie processes?
Its bad because they take up space in the process table which may prevent other processes from running.
159
What are the 6 common signals?
SIGHUP or HUP or 1: Hangup SIGINT or INT or 2: Interrupt SIGKILL or KILL or 9: kill SIGSEGV or SEGV or 11: Segmentation fault SIGTERM or TERM or 15: Software termination SIGSTOP or STOP: stop
160
What are two common special terminal characters that kill / interrupt / suspend a process?
crtl+z ctrl+c
161
how do you kill a process?
kill -9 PID
162
what are the differences between SIGHUP, SIGINT, SIGTERM, SIGKILL, SIGSTOP?
SIGHUP = if a terminal is closed while a process is running SIGINT = ctrl+c SIGTERM = kill the process, but allows it to do some cleanup first SIGKILL = kill the process without any cleanup SIGSTOP = stop/suspend process
163
When multiple processes are running, how is the CPU used amongst them?
in 'time slices' like a round robin, where each processes has a time slice to complete a process. This time slicing is handled by the kernel.
164
What does niceness mean?
It is a way to influence a kernel's scheduling algorithm for time slicing for different processes.
165
What does a low niceness level indicate and what does a high niceness level indicate?
High = low priority for the CPU low = high priority, as much as possible
166
How can you change the niceness level?
nice -n 5 someprocess upgrade
167
what is renice used for?
renice 10 -p 3245 It is for setting priority on an existing service.
168
Where is process information stored?
/proc There is a subdirectory for every process.
169
Let's say you're working on a single terminal window and you're running a command that is taking forever. How can you continue interacting with the shell while that command is running?
You can use the & symbol to tell the command to run in the background.
170
How do you send a job to the background after you have already started running it?
you suspend it with ctrl+z, then run the bg command to send it to the background
171
How do you move a job from the background to the foreground?
fg %{job number} i.e. fg %1
172
What is the '/' directory called? and what does it contain?
root. It contains the entire filesystem hierarchy
173
What does the '/bin' directory contain?
Essential, ready-to-run programs
174
What does the '/boot' directory contain?
kernel boot loader files
175
What does the '/dev' directory contain?
device files
176
What does the '/etc' directory contain?
core system configuration directory, should hold only config files and not any binaries
177
What does the '/home' directory contain?
personal directories for users
178
What does the '/lib' directory contain?
holds library files that binaries can use
179
What does the '/media' directory contain?
used as an attachment point for removable media like USB drives
180
What does the '/mnt' directory contain?
temporary mounted filesystems
181
What does the '/opt' directory contain?
optional application software packages
182
What does the '/root' directory contain?
root user's home directory
183
What does the '/run' directory contain?
info about the running system since the last boot
184
What does the '/sbin' directory contain?
essential system binaries, usually can only be ran by root
185
What does the '/srv' directory contain?
site-sepcific data which are served by the system
186
What does the '/tmp' directory contain?
Storage for temporary files
187
What does the '/usr' directory contain?
user installed software and utilities
188
What does the '/var' directory contain?
variable directory used for system logging, user tracking, caches
189
hard disks can be subdivided into ________
partitions e.g. /dev/sda1 /dev/sda2
190
What are partitions useful for?
separating data, and if you need a certain filesystem, you can easily create a partition instead of making the entire disk one filesystem type
191
What are the two main partition table schemes used
Master boot record (MBR) and GUID Partition Table (GPT)
192
What are disks comprised of ?
partitions, that help organise our data.
193
What can you have inside a partition?
filesystem or dedicate a par
194
What is a filesystem?
organised collection of files and directories. Comprised of a database to manage files and the files themselves
195
What are some different filesystems?
ext4 - most current and standard choice for linuc systems Btrfs - filesystem with snapshots, incremental backups, performance increases XFS - High performance journaling file system NTFS and FAT - windows filesystem HFS+ - Macintosh filesystem
196
How do you make a file system
sudo mkfs -t ext4 /dev/sdb2
197
What must you do before you can view the contents of your filesystem?
mount it. Do mount you need a device location, filesystem type and mount point.
198
What is a mount point?
directory on the system where the filesystem will be attached.
199
How do you mount a new filesystem?
sudo mount -t ext4 /dev/sdb2 /mydrive
200
How do you unmount a filesystem?
sudo unmount /mydrive
201
How can we automatically mount filesystems at startup?
add them to /etc/fstab
202
What is a swap partition?
Swap is what we use to allocate virtual memory to our system, and so if you are low on memory, the system uses this partition to swap pieces of memory of idle processes to the disk, so that you're not bogged down for memory.
203
How do you see the utilisation of your disks i.e. check how much of your disk is free
df -h -h = gives the human readable format use to check how much of your disk is free
204
Let's say your disk is getting full and you want to know what files or directories are taking up that space, what command do you run? i.e. check how much of your disk is being used
du -h
205
what does the fsck /dev/sda command do?
It checks the consistency of a filesystem and can try to repair it for us.
206
What is an inode
It describes everything about a file inc. file type, owner, group, permissions, size, number of block allocated to the file, pointers to the data blocks etc.
207
When are inodes created?
when a filesystem is created, so is the space for inodes.
208
How do you see how many inodes are left on your system?
df -i
209
how do you view inode numbers?
ls -li
210
How do inodes locate files?
inodes point to the actual data blocks of your files
211
what are the 4 stages of the boot process?
1. BIOS (basic input/output system 2. Bootloader 3. kernel 4. init
212
What is BIOS?
Basic input / output system initialises the hardware and makes sure wuth a power-on self test that all hardware is good to go
213
What is Bootloader?
loads the kernel into memory and then starts the kernel with a set of kernel parameters
214
What is kernel responsible for in the boot process?
It initialises devices and memory. The main job of the kernel is to load up the init process
215
What is init responsible for in the boot process?
init is the first process that starts and stops essential services process on the system.
216
When using Sys V, what are the 7 different runlevels?
0: shutdown 1: Single user mode 2: Multiuser mode w/o networking 3: Multiuser mode with networking 4: unused 5:Multiuser mode with networking and GUI 6: reboot
217
How do you list all services?
system --status-all
218
How do you start, stop and restart a service?
sudo service networking start and sudo service networking stop and sudo service networking restart
219
How do you shutdown your system in 2 minutes?
sudo shutdown -h -2
220
How do you restart your system now?
sudo shutdown -r now
221
how do you reboot your system>
sudo reboot
222
what does the lsof command do?
It shows what is in use in a process including all open files and their associated processes.
223
What does the fuser command do?
It is short for file user and tracks infomration about teh process that is using the file or the file user
224
What is example of multi-threading?
Editing and saving simultaneously in a writing application
225
Is it more efficient to have a multi-threaded application or multi-process application?
Multi-threaded
226
What happens in multithreading?
multithreading is where two or more applications with otherwise isolated system resources share these resources, making it easier for them to communicate among each otehr.
227
how can you view process threads?
ps m
228
how can you see the load averages on your system?
uptime
229
how can you monitor CPU usage and disk usage?
iostat
230
What types of information can you see with iostat?
CPU usages at the user level, usage with nice priority, system level, iowait (CPU idle time during an oustanding disk I/O request etc
231
How can you monitor your memory usage?
vmstat
232
What specifically does VMstat show?
number of processes amount of used and free memory, memory used as buffers / cache amount of memory swapped in and out of disk Amount of blocks received in from a block device, sent out to a block device number of interrupts per second, number of context switches per second time spent in user, kernel time, idle
233
What is kept in teh /var directory?
logs
234
What does var/log/syslog contain?
one this is that there is daemon running called syslogd, which waits for event messages to occur.
235
what are the two most important log files in /var/log/..
/messages for messages logged during bootup, auth, cron, daemon /syslog for everything except auth messages
236
What is contained in /var/log/dmesg?
information logged about the kernel ring buffer. Useful for hardware and bootup troubleshooting
237
Where can you find authentication logging?
/var/log/auth.log info such as authorisation logs, user login and authentication method.
238
Where can you find authentication logging?
/var/log/auth.log info such as authorisation logs, user login and authentication method.
239
what does the scp stand for and do?
scp = secure copy. It works the exact same way as the cp command does, but lets you copy from one host to another on the same network.
240
How can you copy a file over from local host to a remote host?
scp myfile.txt username@remotehost.com:/remote/directory
241
How can you copy a file over from a remote host to your local host?
scp username@remotehost.com:/remote/directory/myfile.txt/local/directory
242
how do you copy a directory from local host to remote host?
scp -r .....
243
What does rsync do?
It uses a special algorithm that checks in advance if there is already data that you are copying to and will only cover over the difference. It also checks the intergity with checksum
244
how can you set up a NFS client?
sudo service nfsclient start sudo mount server:/directory /mount_directory
245
how do you view your IP address?
ifconfig -a
246
What does CIDR stand for?
classless inter-domain routing used to represent a subnet mask in a more compact way
247
A network interface is how ______
the kernel links up the software side of networking to the hardware side
248
What does the ifconfig tool allow us to do>
Configure our network interfaces.
249
What does ifconfig do during bootup?
ifconfig runs on bootup and configures our interfaces through config files
250
What does ifconfig show?
1. MAC address 2. inet address (IPv4) 3. inet6 address (IPv6) 4. subnet mask 5. broadcast address
251
How do you create an interface?
ifconfig eth0 {IP address} netmask {subnet} up
252
How do you bring up or bring down an interface?
ifup eth0 ifdown eth0
253
what does the ip command do?
allows us to manipulate the networking stack of a system.
254
What does ip link show do?
shows interface information for all interfaces
255
How do you show the statistics of an interface?
ip -s link show eth0
256
how do you show ip addresses allocated to interfaces?
ip address show
257
How do you add or delete a route ?
sudo route add -net {IP address} ... sudo route del -net ...
258
What is the ICMP?
internet control message protocol used to send updates and error messages and is extremely useful protocol used for debugging network issues
259
how do you check if a packet can reach a host?
ping {ip address}
260
What does traceroute do?
it follows the routing of packets to a domain i.e. google.com
261
How does traceroute work?
it works by sending packets with increasing TTL values, starting with 1. it send message back once the TTL is decremented to zero, thus building a trail.
262
what port is ftp on?
21/tcp
263
ssh port?
22/tcp
264
port 25/tcp
smtp
265
53/tcp
domain
266
http port
80/tcp
267
https port?
443/tcp
268
how can you get information about the various network related information such as network connections, routing tables, interfaces etc?
netstat
269
what does the netstat -a command show?
the listening and non-listening sockets for network connections.
270
how can you map a hostname to an IP address?
put it into /etc/hosts 127.0.1.1 icebox
271
What does nslookup do?
used to query name servers to find information about resource records i.e. gives info about address, server, location etc
272
What is a poweful tool for getting information about DNS name servers>
dig