Generating an SSH Keypair
Linux / macOS
-
Open a terminal.
-
Generate the key:
ssh-keygen -t ed25519 -f key -P ''
Your keys:
- Private key:
./key— never share this. - Public key:
./key.pub— safe to share.
Print the public key to copy it:
cat ~/.ssh/id_ed25519.pub
Windows
Use PowerShell
-
Open PowerShell.
-
Generate the key:
ssh-keygen -t ed25519 -f key -P ''
Print the public key to copy it:
powershell type ./key