Generate an SSH key pair by running the following command: ssh-keygen -t ed25519
You will be prompted to choose a location and provide a custom name for the key. You can press Enter to accept the default location and name.
Remember the location where you stored the key. If you accepted the default location, it should be stored in ~/.ssh/id_rsa
(private key) and ~/.ssh/id_rsa.pub
(public key).
Open the file containing the public key with a text editor. You can use the following command to open it:
nano ~/.ssh/id_rsa.pub
Copy all the content of the public key file. OR you can use Magic Wormhole to send it to any machine
to copy the file to the clipboard
pbcopy < name_of_file
or
cat < name_of_file
You can retrieve the keys with this GitHub URL [https://github.com/<username>.keys](https://github.com/<username>.keys)
OR
1. Send the key into the server using
```bash
sh-copy-id [email protected]
```
or log in to the server and
```bash
echo "ssh-rsa xxxx@Hello" >> ~/.ssh/authorized_keys
```