From bed2e6677264dd17c2dec006a16cb9a7dac1adbc Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 28 Oct 2019 13:23:19 +0000 Subject: [PATCH] [201/lab sheet] Make ssh authorised key bit more clear --- 201/Lab-Sheet.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/201/Lab-Sheet.md b/201/Lab-Sheet.md index bcdc60e..71ba548 100644 --- a/201/Lab-Sheet.md +++ b/201/Lab-Sheet.md @@ -185,8 +185,8 @@ _If your **local machine** is a Linux computer, then this is the section for you If you are using Linux on your _local machine_ generate your own public-private keypair like so: - ```bash +mkdir $HOME/.ssh ssh-keygen -t ed25519 ``` @@ -242,13 +242,14 @@ When you’re done, click the "save private key" button and select a secure loca If you have not entered a passphrase, you will be asked to confirm that you want to save the key without one. We strongly recommend using a passphrase, but you can press enter to bypass this prompt. -Next, you need to tell your server about your new SSH key. This is done by editing the `~/.ssh/authorized_keys` file. Do that like this: +Next, you need to tell your server about your new SSH key. This is done by editing the `~/.ssh/authorized_keys` file. The `~/.ssh/` directory might not exist, so we may need to create that too. Do that like this: ```bash +mkdir ~/.ssh/; nano ~/.ssh/authorized_keys ``` -Paste in your public key that saved earlier. Save it and exit, and then ensure it has the correct permissions like so: +Of course, don't worry about any errors telling you that `~/.ssh/` already exists. Next, paste in your public key that saved earlier into the `nano` text editor. Save it and exit (Ctrl + X, then Y, then Enter), and then ensure it has the correct permissions like so: ```bash chown -R username:username ~/.ssh