Language
November 24, 20263 min read

SSH Keys on iPhone: How to Use Them Safely (2026)

The safest SSH key on an iPhone is one you generate on the phone and store in the Secure Enclave. The private key never leaves the chip.

If you'd rather keep no private key on the phone at all, Macky opens your Mac's own shell, so your keys stay on the Mac.

Generate the Key on the Phone

Termius and Blink Shell can both create a key on the device. Generating in the app beats importing, because the private key never exists anywhere else.

Termius

Open Keychain, tap +, then tap Generate Key. Termius says it can store the key in the Secure Enclave.

Blink Shell

Run config, tap Keys, then tap +. Choose Generate SE Key for a Secure Enclave key. Generate New makes an ordinary key. Copy the public key from that key's configuration screen.

Paste the public key as a new line in this file on the Mac:

~/.ssh/authorized_keys

Remote Login must be on. The steps are in how to SSH into a Mac.

Why Secure Enclave Keys Are P-256 Only

The Secure Enclave only holds NIST P-256 (secp256r1) keys.

Key typeIn the Secure Enclave
NIST P-256Yes
Ed25519No
RSANo

The enclave only signs. Keys made there can't be imported or backed up.

Keep the Keys on Your Mac Instead

A key on the phone is one more place a private key can leak. Macky gives your iPhone a real shell on your Mac, so ssh to a server uses the Mac's existing SSH config and keys.

Macky terminal on iPhone running ssh from the Mac's own shell

The keys never go to the phone. The connection is end-to-end encrypted WebRTC with no open ports. A master password protects the Mac, and each new iPhone must be approved on the Mac first. More detail is in Is Macky Safe?.

If You Import an Existing Key

Termius can import keys. Tap +, then Import Key or Paste Key. An imported key is a normal key with a copy of your private key on the phone, because the Secure Enclave can't take in keys created elsewhere.

Lost Phone or Rejected Key

Secure Enclave keys can't be moved or backed up. If you lose the phone, remove that key's public key line from ~/.ssh/authorized_keys on the Mac.

If a copied key is rejected, the cause is usually a curve mismatch. Generate a new key on the phone and add its public key to the Mac. For the full walkthrough, see how to SSH into your Mac from your iPhone.

FAQ

Can I use an Ed25519 key in the iPhone Secure Enclave?

Yes, but only P-256 (NIST secp256r1) keys. Ed25519 and RSA keys can't be stored in the Secure Enclave.

Can I back up a Secure Enclave SSH key?

No. A key created in the Secure Enclave can't be imported or backed up, and the private key never leaves the chip. If you need the same key on several devices, use an ordinary key.

Do I need SSH keys on my iPhone to reach my Mac?

No. Macky opens your Mac's own shell, so an ssh command to a server uses the keys already on the Mac. The keys never go to the phone. See how to access your Mac without SSH.

Which iPhone SSH apps support Secure Enclave keys?

Both Blink and Termius. Blink offers Generate SE Key next to Generate New. Termius can store a generated key in the Secure Enclave. For a wider comparison, see best iOS SSH clients.

Try Macky

Connect to your Mac terminal from your iPhone.