<aside> <img src="/icons/book_gray.svg" alt="/icons/book_gray.svg" width="40px" /> Table of Contents
</aside>
An SSH key pair consists of a public key and a private key. The public key is used to encrypt data, and only the corresponding private key can decrypt it. This setup is commonly used for secure authentication. Below are the steps to generate an SSH key pair on macOS.
<aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> Note: We only approve secure SSH connections using SSH keys to our servers. This ensures enhanced security and authentication. Follow the steps below to generate an SSH key pair and use it for secure connections.
</aside>
Your public key will start with something like this:
ssh-ed25519 AAAAB3NzaC1yc2EAAAA...
Use the following command to generate a new SSH key pair:
ssh-keygen -t ed25519 -C "[email protected]"
Replace [email protected] with your actual email address. This email address is used as a label for the key.
~/.ssh/id_ed25519.Once the key pair is generated, you need to copy the public key to your clipboard. Use the following command to do so:
pbcopy < ~/.ssh/id_ed25519.pub
This command copies the contents of your public key file to the clipboard.
Open PowerShell:
Install OpenSSH (if not already installed):
Ensure OpenSSH is installed by running the following command:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
If OpenSSH is not listed as installed, you can install it with:
Add-WindowsCapability -Online -Name OpenSSH.Client*
Generate a New SSH Key:
Use the following command to generate a new SSH key pair:
ssh-keygen -t ed25519 -C "[email protected]"
Replace [email protected] with your actual email address. This email address is used as a label for the key.
Specify the File Location:
C:\\\\Users\\\\YourUserName\\\\.ssh\\\\id_ed25519.Enter a Passphrase (Optional):
Copy the Public Key:
To copy the public key to the clipboard, use the following command:
Get-Content C:\\\\Users\\\\YourUserName\\\\.ssh\\\\id_ed25519.pub | clip
This command copies the contents of your public key file to the clipboard.