Review questions Flashcards
What are SSH keys? What are the purpose of them?
SSH keys are created using public key cryptography and is used to verify your identity when making an ssh connection to another server.
Where are SSH keys in the local machine? server?
local machine = ~/.ssh
server = ~/.ssh/authorized_keys
What commands create ssh keys?
ssh-keygen
(useful flags: -t to specify which encryption method, -f for folder location for key)
How does the ssh command work?
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 to move up, down, right, left in nvim?
h-left
j- down
k- up
l-right
How do you move to the top of the buffer in nvim?
gg
How do you move to the bottom of the buffer in nvim?
G
How do you move to the start of a line in nvim?
0
How do you move to the end of a line in nvim?
$ (or A to move it at the end and into insert mode)
What are the four basic nvim modes?
- Insert (I)
- Command (:)
- Visual (v)
- Replace (R)
How to force quit in nvim?
:q!
How to save in nvim?
:w
/etc
configuration files
/usr
contains system-wide, read-only files
/bin
Holds binary files like important commands
/home
home dir for all users
what is cloud-init? what is its purpose?
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
What is a process?
a program loaded into memory and is running
In what order is commands read by the shell?
- Shell functions 2. Shell built ins 3. Path var
what does ps -e do
shows all running processes
what does ps -o do
alters the output by specifying desired columns
i.e. ps -o pid
How do you search for files?
find dir [options] pattern
ie find . -type f -name file1
How do you search for a pattern inside a file?
grep [options] pattern filepath
ie grep -i [abc] file1
How do you create enviromental variables?
exporting a regular var will turn it into a environmental variable
i.e. export ENV_VAR