From 4bb6fac7af6e052cb1efcdf9cf2a284a19a75f3f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 19 Dec 2021 14:56:48 +0000 Subject: [PATCH] ssh-keygen more explanation and example --- handbook/computing/keyexchange.html | 35 +++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/handbook/computing/keyexchange.html b/handbook/computing/keyexchange.html index fa3a0964c..abc20c136 100644 --- a/handbook/computing/keyexchange.html +++ b/handbook/computing/keyexchange.html @@ -45,7 +45,7 @@

This is an example of the whole interaction where the key file has been given a different name:

-$ ssh-keygen -C "philip@muscogee-wsl"
+$ ssh-keygen -C "philip@muscogee-wsl"
 Generating public/private rsa key pair.
 Enter file in which to save the key (/home/philip/.ssh/id_rsa): id_rsa_wsl
 Enter passphrase (empty for no passphrase):
@@ -67,9 +67,40 @@ The key's randomart image is:
 |oo               |
 +----[SHA256]-----+
 $
-
+
 
+

This will enable ssh login instantly. Check that it has worked by logging in to the expo server like this: + +$ ssh expo@expo.survex.com + +

If it didn't work

+

You may get this response if the public key has not been loaded properly on the server or if your laptop has not loaded the secret key properly. + +expo@expo.survex.com: Permission denied (publickey). + +

    +
  1. Check that ssh-keygen has put both files into your Linux home .ssh folder on your laptop, +if not, then move them there: + +$ mv id_rsa_wsl* ~/.ssh + +where id_rsa_wsl is the 'file in which to save the key' you specified above. +

  2. +
  3. Check that the ssh agent process is running and fix it if it is not (full details of how to do this +give at www.ssh.com/academy/ssh/agent) + +$ ssh-add -l + +and if the process is not running, start it like this + +$ eval `ssh-agent` + +Check that the key is loaded by running ssh-add -l and then test that you can login again. +

  4. +
+

If it still doesn't work, read the online +documentation, start from scratch, and do it all again but this time using all the defaults and without trying to be clever.

MacOS

  • Erm, dunno...please fill in