Which SSH key file can I share with the server administrator?
Share the public key, normally the filename ending in .pub. Keep the corresponding private-key file confidential. The public key authorises a cryptographic identity on the server, while the private key proves possession of that identity.
Instructions
1. Identify the two filenames
List the files without displaying their contents. A customised filename is normal; the matching suffix is what matters.
Get-Item "$env:USERPROFILE\.ssh\server_ed25519", "$env:USERPROFILE\.ssh\server_ed25519.pub" | Select-Object Name, LengthThis lists the named files and sizes. It does not reveal their key material.
2. Display only the public key when enrolment requires it
Public keys are usually a single line beginning with an algorithm identifier. Send it through the administrator’s approved enrolment channel.
Get-Content -LiteralPath "$env:USERPROFILE\.ssh\server_ed25519.pub"The .pub suffix is deliberate. Never substitute the private-key filename for this command.
3. Confirm identity using a fingerprint
A fingerprint is useful for checking that the correct public key was received. A comment at the end of the key is only a label and is not proof of the owner’s identity.
Check the result
- Only the .pub file or its public fingerprint is shared.
- The administrator confirms which account the public key will authorise.
Troubleshooting
- The file begins with a private-key header
- Do not share it. Verify the filename and choose the public .pub file.
- The private key has already been exposed
- Treat the identity as compromised, enrol a replacement and revoke the exposed key on every affected server.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
