13 Mar, 2024
The term web server can refer to hardware or software, or both of them working together.
On the hardware side, a web server is a computer that stores web server software and a website’s component files (for example, HTML documents, images, CSS stylesheets, and JavaScript files). A web server connects to the Internet and supports physical data interchange with other devices connected to the web.
On the software side, a web server includes several parts that control how web users access hosted files. At a minimum, this is an HTTP server. An HTTP server is software that understands URLs (web addresses) and HTTP (the protocol your browser uses to view webpages). An HTTP server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user’s device.
MDN (2024)
A static web server, or stack, consists of a computer (hardware) with an HTTP server (software). We call it “static” because the server sends its hosted files as-is to your browser.
MDN (2024)
A dynamic web server consists of a static web server plus extra software, most commonly an application server and a database. We call it “dynamic” because the application server updates the hosted files before sending content to your browser via the HTTP server. :::aside::: MDN (2024) :::
If you want to use git, ssh or mail encryption you need to understand how public key cryptography works.
After working through this guide you should be able to
In the 1970ies several cryptographers invented public-key cryptography independently of each other. With the low computing power available then it could not be used in practice. Since the 1990ies it is used widely in ssh, e-mail encryption and SSL/TLS.
is to have an assymetric encryption system: two different keys are used: a public key for encryption and a private key for decryption.
We will be using public key cryptography for ssh and maybe git. For these systems the keys are stored in a folder .ssh in your home directory.
id_rsa
- your private key is stored in ~/.ssh/id_rsa
id_rsa.pub
- your public key is also in ~/.ssh/id_rsa
The directory .ssh
can also contain two other important files: config
and authorized_keys
.
But first: how do you get a key pair?
Decide which e-mail address you want to use. Type this in the terminal:
ssh-keygen -C exampleme@example.com -t rsa
Press enter to accept the default key save location. Do not use a passphrase.
After key generation is complete, you’ll have output that looks like this:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/student/.ssh/id_rsa):
Created directory '/home/student/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/student/.ssh/id_rsa.
Your public key has been saved in /home/student/.ssh/id_rsa.pub.
The key fingerprint is:
88:54:ab:11:fe:5a:c3:7s:14:37:28:8c:1d:ef:2a:8d exampleme@example.com
Now check if your two keys are really stored in ~/.ssh/id_rsa
and ~/.ssh/id_rsa.pub
!
~/.ssh/authorized_keys
, then ssh will let you log in without giving a passwordThe authorized_keys file can contain several public keys:
ssh-rsa AAAAB3NzaC...2EAAAABI== alice@plus.ac.at
ssh-rsa AAAAB8NzaC...DVj3R4Ww== bob@plus.ac.at