Practical use and limits

Use it for: Use the conversion workflow only on a trusted machine: derive and compare public keys after every export, record which client needs which format, and delete unnecessary private-key copies.

Limits: A converted private key remains a credential. Mobile import requirements can change; do not upload private material to online converters or treat a file extension as proof of format.

The short answer

The key algorithm and the private-key container format are different questions. Ed25519 describes the cryptographic key type. OpenSSH and PKCS8 describe how the private key is serialized on disk. A Mac command-line SSH client may accept an OpenSSH private key while a mobile app may ask for PKCS8 PEM. The safest pattern is one Ed25519 identity, one server-side public key, and a correctly formatted private-key copy for each client.

Keep the public key as the shared identity

The server does not need a separate public key for every file format. It stores the public half in the account's authorized_keys file and verifies a signature made by the matching private key. When you export the same private key to another supported format, the derived public key stays the same. Before changing configuration, print the public key derived from each file and compare the full line, including the algorithm prefix and final comment.

OpenSSH versus PKCS8

An OpenSSH private key commonly begins with BEGIN OPENSSH PRIVATE KEY and is the natural format for the system ssh client. An unencrypted PKCS8 PEM file commonly begins with BEGIN PRIVATE KEY and is a portable serialization that some application importers require. File extensions such as .pem do not prove the actual format. Inspect the header and use a library that supports Ed25519 when the platform's older OpenSSL or LibreSSL tooling reports an unsupported algorithm.

A reliable conversion workflow

Generate the Ed25519 key on the computer you trust, protect the OpenSSH file, and add only its public key to the server. If a second client requires PKCS8, export a copy with a current cryptography library in an isolated environment. Do the reverse only when necessary. Avoid pasting private-key contents into chat, tickets, shell history, or shared cloud notes. After conversion, derive and compare the public key before importing the new file.

Configuration and verification

Use an explicit Host block with HostName, User, Port when needed, and IdentityFile pointing to the correct client file. First run ssh -v or the app's connection diagnostics and confirm which identity is offered. A successful TCP connection proves only that the server is reachable; successful public-key authentication proves that the offered private key matches an authorized public key. Keep a second, already-tested access path before replacing the only working credential.

Bottom line

The recurring mistake is treating a file format, a key algorithm, and a server authorization record as the same thing. They are three layers. Align Ed25519 with Ed25519, align each client with the format it actually accepts, compare derived public keys, and keep the private files private. This guide explains a general SSH workflow; product support, import rules, and server policies can change and should be checked against current documentation.

Frequently asked questions

Do I need two different SSH keypairs?

Usually no. One Ed25519 keypair can authorize both clients. You may need two private-key files because different clients accept different serialization formats.

Does changing OpenSSH to PKCS8 change the public key?

No, when the conversion uses the same private key, the derived public key remains the same. Verify it instead of trusting a filename or extension.

Should I remove the passphrase to make mobile import easier?

Only if the importer requires it and you understand the risk. An unencrypted private key needs strong device protection, restrictive storage, and a plan to revoke the corresponding public key if the file is exposed.

References