Review questions Flashcards

1
Q

What are SSH keys? What are the purpose of them?

A

SSH keys are created using public key cryptography and is used to verify your identity when making an ssh connection to another server.

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

Where are SSH keys in the local machine? server?

A

local machine = ~/.ssh
server = ~/.ssh/authorized_keys

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

What commands create ssh keys?

A

ssh-keygen

(useful flags: -t to specify which encryption method, -f for folder location for key)

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

How does the ssh command work?

A

provide identity file with -i, user to login as and ip address of server

ie ssh -i /path/to/key root@123.342.234

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

How to move up, down, right, left in nvim?

A

h-left
j- down
k- up
l-right

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

How do you move to the top of the buffer in nvim?

A

gg

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

How do you move to the bottom of the buffer in nvim?

A

G

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

How do you move to the start of a line in nvim?

A

0

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

How do you move to the end of a line in nvim?

A

$ (or A to move it at the end and into insert mode)

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

What are the four basic nvim modes?

A
  1. Insert (I)
  2. Command (:)
  3. Visual (v)
  4. Replace (R)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to force quit in nvim?

A

:q!

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

How to save in nvim?

A

:w

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

/etc

A

configuration files

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

/usr

A

contains system-wide, read-only files

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

/bin

A

Holds binary files like important commands

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

/home

A

home dir for all users

17
Q

what is cloud-init? what is its purpose?

A

It is configuration file written in YAML for web server creation, allows for the quick setup of servers by providing pre configurations that can install packages, create users, restrict certain actions etc

18
Q

What is a process?

A

a program loaded into memory and is running

19
Q

In what order is commands read by the shell?

A
  1. Shell functions 2. Shell built ins 3. Path var
20
Q

what does ps -e do

A

shows all running processes

21
Q

what does ps -o do

A

alters the output by specifying desired columns
i.e. ps -o pid

22
Q

How do you search for files?

A

find dir [options] pattern
ie find . -type f -name file1

23
Q

How do you search for a pattern inside a file?

A

grep [options] pattern filepath

ie grep -i [abc] file1

24
Q

How do you create enviromental variables?

A

exporting a regular var will turn it into a environmental variable
i.e. export ENV_VAR

25
Q
A