1.8 KiB
1.8 KiB
-
Copy the SSH public key to your clipboard.
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace. {% mac %}
$ pbcopy < ~/.ssh/id_ed25519.pub # Copies the contents of the id_ed25519.pub file to your clipboard{% tip %}
Tip: If
pbcopyisn't working, you can locate the hidden.sshfolder, open the file in your favorite text editor, and copy it to your clipboard.{% endtip %} {% endmac %} {% windows %}
$ clip < ~/.ssh/id_ed25519.pub # Copies the contents of the id_ed25519.pub file to your clipboard{% note %}
Notes:
- With Windows Subsystem for Linux (WSL), you can use
clip.exe. Otherwise ifclipisn't working, you can locate the hidden.sshfolder, open the file in your favorite text editor, and copy it to your clipboard. - On newer versions of Windows that use the Windows Terminal, or anywhere else that uses the PowerShell command line, you may receive a
ParseErrorstating thatThe '<' operator is reserved for future use.In this case, the following alternativeclipcommand should be used:
$ cat ~/.ssh/id_ed25519.pub | clip # Copies the contents of the id_ed25519.pub file to your clipboard{% endnote %} {% endwindows %} {% linux %}
$ cat ~/.ssh/id_ed25519.pub # Then select and copy the contents of the id_ed25519.pub file # displayed in the terminal to your clipboard{% tip %}
Tip: Alternatively, you can locate the hidden
.sshfolder, open the file in your favorite text editor, and copy it to your clipboard.{% endtip %} {% endlinux %}
- With Windows Subsystem for Linux (WSL), you can use