Versions Compared

Key

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

...

To do this while logged in to the instance, you can simply append the public key to the authorized_keys file directly using copy and paste (e.g. nano ~/.ssh/authorized_keys then paste in the string of characters from the public key) or.


If the public key has been transferred to your instance, the contents of the file may be appended using the following example:

Code Block
cat id_rsa.pub >> ~/.ssh/authorized_keys

...

Alternatively, if not logged into the instance, you can run the following from a local terminal session. By default, the ssh-copy-id command appends keys to the remote user's ~/.ssh/authorized_keys file:

Code Block
ssh-copy-id -i <public_key_file_to_add> ubuntu@<ip_address_of_instance>

...