Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
# Generate a 2048-bit RSA key (Will NOT work with GitHub!)
$> ssh-keygen -t rsa -b 2048 -f mykey.rsa.key
Generating public/private rsa key pair.
# (blah blah blah)

# Or
# Generate a 521-bit ecdsa key (WILL work with GitHub!)
# Yes - 521-bits (not 512) because (2^521)-1 is a prime number 
# See https://en.wikipedia.org/wiki/Elliptic-curve_cryptography
$> ssh-keygen -t ecdsa -b 521 -f mykey.ecdsa.key
Generating public/private ecdsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in mykey.ecdsa.key
Your public key has been saved in mykey.ecdsa.key.pub
The key fingerprint is:
SHA256:mri4SXfnLwf77L8UmzFf4DOW0e/LODuV/cixmDOw7+Q johnmckeever@localhsot
The key's randomart image is:
+---[ECDSA 521]---+
|                 |
|                 |
|              .  |
|             . . |
|       S  .   = +|
|    . o.  o . .@o|
| . o + .o =.= ==+|
| . + o oo.*o=+B +|
|  +..   .B*=E*=o |
+----[SHA256]-----+

# Copy the public key of your computer to the trusted keys of the target server
localhost:~$ ssh-copy-id -i .ssh/mykey.ecdsa user@remotehost
user@remotehost's password: ••••••••

Info

Note that the following steps are not required when using the generated key with MettleCI Workbench.

Now try logging into the machine, with ssh 'user@remotehost' to verify the keys we’ve added:

...