Configure SSH access into an Ubuntu Server
The following notes are a subset of the information provided in this tutorial.
Prerequisites
- An instance of Ubuntu Server running.
- An account on the server that can be elevated to root and that you know the password for.
Create an SSH Key pair
The tutorial does this manually on the command line which is fine, however you can also use PuTTYGen:
- Optional - change the bits to 4096.
- Click Generate.
- Copy the contents of box (something like ssh-rsa AAAAB3NzaC1…) into a file with a .pub extension. This is simplest option to avoid some of the file format gotchas in this question.
- Click Save private key and save to a file with the same name as the previous one but with no extension.
Copy the public key to the remote Ubuntu Server
You should be able to run the following (exactly as shown in the tutorial):
Remember which key file to use with the domain
- Open .ssh directory under your user folder (or create it if it does not exist).
- Open the config file (or, again, create it if it does not exist).
- Add the following:
References
Written on January 16, 2020