Convert from RSA to Ed25519

Convert from RSA to Ed25519

73
Created On 11/10/26 10:53 AM - Last Modified 11/10/26 15:50 PM


Objective


The Issue

SSH-PSM logins to specific newer Linux targets (RHEL9+ and Amazon Linux 2023+) through the HTML5 Gateway fail when using public key authentication with the error "The server refused our key."

 

The Cause

The Linux target uses the newer OpenSSH (8.8+) which, by default, disables ssh-rsa signatures.

 

Starting with OpenSSH 8.8, ssh-rsa SHA-1 signatures are rejected, even if:

  • +ssh-rsa is added to PubkeyAcceptedAlgorithms
  • The public key in authorized_keys is ssh-rsa

because PubkeyAcceptedAlgorithms affects only the PSM/HTML5 Gateway server’s presentation of accepted public key algorithms. However, for these connections the signature algorithm used is controlled by the client, and Idira PSM typically signs using ssh-rsa (SHA-1) unless configured otherwise. Therefore, the Linux target rejects the signature, resulting in:

“Server refused our key.”

 

The connection may work manually because the local OpenSSH client supports rsa-sha2-256 / rsa-sha2-512, so the target accepts it. Idira PSM does not unless configured.

 

How to Confirm

On the target, check /var/log/auth.log or secure:

 

Likely errors:

userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms
or
userauth_pubkey: signature algorithm ssh-rsa not accepted



Environment


14.4;14.5;14.6 Privileged Access Manager (PAM, self-hosted) PSM;Privileged Session Management (PSM);PSM for web

Procedure


The Solutions

This is a ready-to-run, end-to-end migration plan to move managed SSH keys in Idira from RSA → Ed25519. It contains the relevant Idira docs and other references and included the exact UI clicks, REST API calls (where useful), ssh-keygen commands, testing steps, and rollback notes that may be needed.

 

High-level Overview

  1. Verify prerequisites (Idira version / plugin support & target OpenSSH support).

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

https://www.openssh.com/releasenotes.html

  1. Create a new platform (copy of the existing SSH Keys platform) configured to generate Ed25519 keys.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/using%20ssh%20keys.htm

  1. Decide whether to rotate in place (let CPM/SSH Key Manager generate new Ed25519 keys and push them to targets) or manually import Ed25519 private keys into the Vault and associate accounts. Both options are covered.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm?Highlight=ssh+rotation

  1. Test against a small pilot set of targets, verify synchronization and login.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

  1. Roll out at scale via platform/account updates and scheduled rotation.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/using%20ssh%20keys.htm

 

Prerequisites & Important Notes

  • Idira version / plugin: Ed25519 private SSH keys are supported in the Private SSH Keys plugin starting with private SSH keys plugin v14.5+ (so confirm the platform/plugin version). If the installed version is below that, it is required to upgrade the plugin/platform first.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

  • Private key format: Idira supports OpenSSH (PEM) private key format for SSH Keys; Ed25519 keys are supported as private keys in Vault. If a key was uploaded in a different format, convert it to OpenSSH PEM first.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

https://docs.cyberark.com/mis-self-hosted/Docs/25.1/TopNav/Content/Credentials/t-Credentials-PrivateKey-creating.php

  • Target servers (sshd): ssh-ed25519 is supported by OpenSSH since 6.5 (Jan 2014). If any target runs very old OpenSSH (pre-6.5), upgrade it (or keep those hosts on RSA until upgraded). Verify all targets' sshd version.

https://www.openssh.com/releasenotes.html

 

Solution 1 — Let Idira Generate and Rotate Keys to Ed25519 (Recommended for Scale)

This uses the SSH Key Manager / CPM to generate ed25519 keypairs and push public keys to target ~/.ssh/authorized_keys. It is good for large environments.

  1. Backup Settings and Take a Snapshot
    1. Export the list of current SSH key accounts (Account IDs / Safes / Platforms) and take a Vault backup or snapshot per change control. (Basic: Export CSV from PVWA Accounts list or use REST API to list accounts.)
    2. Note current platform settings (copy/paste Generate Key properties).
  2. Create a Platform Configured for Ed25519
    1. PVWA → Administration → Platform Management.
    2. Select any existing “Unix via SSH Keys” (or the platform currently used) → Duplicate (to retain existing managed RSA keys). Give it a clear name like Unix via SSH Keys - Ed25519.
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/using%20ssh%20keys.htm
    3. Edit the Generate Key properties:
      1. PrivateKeyFormat = OpenSSH (PEM) (default).
        1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm
      2. KeyEncryption = Ed25519.
      3. KeySize = 256 (Ed25519 uses 256).
      4. KeyGenerationTimeout — for high latency targets increase from default 90s.
      5. PublicSSHKeyPath — default ~/.ssh/authorized_keys (or a custom path).
    4. Save and Activate the new platform.
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm
  3. Pilot: Create and Test One New SSH Key Account Using the Ed25519 platform
    1. Option 1 (generate via CyberArk):
      1. PVWA → Accounts → Add Account → choose Unix via SSH Keys - Ed25519 (the new platform) → fill Host/Username/Safe etc.
      2. When provisioning, the Key Manager will generate an ed25519 private/public keypair, store the private key in the Vault and push the public key to the target account’s authorized_keys location.
        1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/add%20account%20v10.htm
        2. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm?Highlight=ssh+rotation
    2. Option 2 (onboard an existing Ed25519 keypair that has been generated locally) — see “Manual import” below.
  4. Verify
    1. From a separate test client, attempt SSH auth using the Vault-managed key (retrieve key via PVWA ‘Retrieve private SSH key account’ flow or use PSM). Use the PVWA retrieve or the CPM process that the workflow uses. Confirm successful login as the target user via the ed25519 key.
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/retrieve_private_ssh_key_account.htm
      2. In PVWA/SSHKM verify the account status shows synchronized; run Verify keys are synchronized and Reconcile if needed.
        1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm
  5. Rotate existing RSA-managed accounts to Ed25519
    1. Approach: For each RSA SSH key account managed by Vault, change the account’s platform to the new - Ed25519 platform and run a Change SSH Key (rotation) operation (manual or scheduled) so the CPM/SSH Key Manager generates a new Ed25519 keypair and pushes the public key to the target.
    2. Steps:
      1. PVWA → Accounts → Select account(s) → Edit account → change Platform to Unix via SSH Keys - Ed25519 → Save.
      2. From the account row, choose Change SSH Key (or run a manual rotate) — this triggers generate/push. Alternatively, schedule rotation per organization policy.
        1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm?Highlight=ssh+rotation
    3. Confirm via Verify/Reconcile that the private key in Vault matches public key on target.
  6. Scale rollout
    1. After successful pilot, change platform for batches of accounts and run scheduled rotations. Monitor for failures and reconcile as needed. Use PVWA notifications / alerts for unsynchronized keys.
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

 

Solution 2 — Manually Generate Ed25519 Keys and Import Them into Idira (useful when key material must be controlled)

Use this when keys are generated by an external process (HSM, hardened build process) and then the private key is uploaded to Vault.

  1. Generate the ed25519 key locally (example commands)
    1. Generate a keypair and protect with passphrase (recommended) or empty passphrase if policy requires:
      1. # generate and add a comment for traceability
        ssh-keygen -t ed25519 -f /tmp/id_ed25519_cyberark -C "cyberark-ed25519-2025-teamX" -N 'passphrase'
    2. For an unencrypted private key (not recommended), use -N "".
  2. Ensure format is compatible
    1. Idira expects OpenSSH (PEM). Recent OpenSSH stores ed25519 in OpenSSH private key format by default. However, while OpenSSH versions can read PKCS8 now, Idira expects OpenSSH PEM. To convert them to PEM PKCS8/legacy formats:
      1. # convert to OpenSSH PEM if required (example)
        ssh-keygen -p -m PEM -f /tmp/id_ed25519_cyberark -N 'passphrase'

        (Test by ssh-keygen -y -f /tmp/id_ed25519_cyberark to get public key output.)
      2. Note: If the OpenSSH version is very new, it may support PEM variants; the Vault expects OpenSSH format—test imports.
        1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm
        2. https://superuser.com/questions/1840476/which-ed25519-pem-keys-does-openssh-9-6-support
  3. Extract the public key
    1. ssh-keygen -y -f /tmp/id_ed25519_cyberark > /tmp/id_ed25519_cyberark.pub
      # or cat /tmp/id_ed25519_cyberark.pub
  4. Push public key to target(s)
    1. On target host(s) append the pubkey to ~targetuser/.ssh/authorized_keys (or the path used on the target platform). Use correct permissions: .ssh = 700, authorized_keys = 600. The SSH Key Manager can create the file automatically if PopulateKeyIfNotExist is enabled.
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm
  5. Import private key into Vault
    1. PVWA UI: PVWA → Accounts → Add Account → choose Unix via SSH Keys - Ed25519 (or appropriate platform) → when creating account choose Manually add an SSH key and paste the private key content into the Private Key field (or upload file), fill other required metadata and Save. (See “Protecting/Securing” docs.)
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/protecting%20securing.htm
      2. https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/add%20account%20v10.htm
    2. REST API: Use POST /PasswordVault/API/Accounts (2nd gen API) with a private key credential payload to create the SSH key account (the private key field is supported — see Private key example in API docs). Example reference: Example 7 Private key credential.
      1. https://docs.cyberark.com/mis-self-hosted/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Credentials-CreatePK.php?TocPath=REST+APIs%7CWeb+SDK+REST%7CCredentials%2C+Identity%2C+and+Permissions+endpoints%7CCredentials+API%7CPOST+Credentials%2FCreate%7C___
      2. https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/add%20account%20v10.htm
  6. Verify in PVWA & Test login
    1. Retrieve the private key via PVWA retrieve operation or use the vault-managed access (PSM/CPM) to open a session and verify a successful log in. Also run the SSHKM “Verify keys are synchronized” operation and run Reconcile if necessary.
      1. https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/retrieve_private_ssh_key_account.htm
      2. https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

 

Testing Checklist (pilot)

  • Confirm platform KeyEncryption=Ed25519 activated.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

  • On target, confirm authorized_keys contains ssh-ed25519 ... entry and file permissions are correct.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

  • From client, attempt to SSH using the Vault-managed key (use PVWA retrieve or PSM session). Confirm success.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/retrieve_private_ssh_key_account.htm

  • In PVWA/SSHKM run “Verify keys are synchronized” and confirm no unsynchronized keys. If unsynchronized, run Reconcile.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

  • Observe logs (CPM/SSHKM) for any failures (timeouts, permission errors). Increase generation timeout in platform if necessary.

 

Common pitfalls & how to avoid them

  • Old OpenSSH on targets — Ed25519 will fail if target’s sshd is older than ~6.5. Check the package version with this command

sshd -V

If legacy hosts are found, exclude them from mass conversion and keep RSA for those until upgraded.

https://www.openssh.com/releasenotes.html

  • Private key format mismatch — Idira expects supported formats (OpenSSH PEM). If uploads fail, convert the key locally (ssh-keygen -p -m PEM -f ...) or let Idira generate the key.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

  • Reconcile account permissions — The reconcile account must have root or power user privileges and be able to update authorized_keys. If it uses password authentication, PasswordAuthentication must be yes on the target during reconcile.

https://docs.cyberark.com/pam-self-hosted/latest/en/content/sshkm/managing%20ssh%20keys.htm

 

Rollback plan

If ed25519 rollout causes failures:

  1. Use the Vault backup to restore previous private keys (if a backup was performed).
  2. Reassign impacted accounts back to the RSA platform (if the original platform was left intact) and run a Change SSH Key to regenerate the prior RSA key (if it was stored) or restore from backup copy of private key.
  3. If a host lost access, use local console or secondary account (break-glass) to re-add the old public key into authorized_keys. Always keep a break-glass method for critical systems.

 

Quick Copy-Paste Commands (summary)

Generate ed25519 locally:

ssh-keygen -t ed25519 -f /tmp/id_ed25519_cyberark -C "cyberark-ed25519-2025-team" -N 'PassphraseHere'
ssh-keygen -y -f /tmp/id_ed25519_cyberark > /tmp/id_ed25519_cyberark.pub

 

Optionally convert to PEM if required:

ssh-keygen -p -m PEM -f /tmp/id_ed25519_cyberark -N 'PassphraseHere'

 

Append public key to target (as targetuser):

mkdir -p ~targetuser/.ssh && chmod 700 ~targetuser/.ssh
cat /tmp/id_ed25519_cyberark.pub >> ~targetuser/.ssh/authorized_keys
chmod 600 ~targetuser/.ssh/authorized_keys
chown -R targetuser:targetgroup ~targetuser/.ssh

 

Call Idira REST API to add private-key account (example endpoint):

POST https://<PVWA>/PasswordVault/API/Accounts
# body: JSON with CredentialType: "PrivateKey", Value: "<private-key-content>", PlatformId: "<platform-id>", Safe: "<safe-name>", etc.

 

(See API docs Example 7 for the private key payload.)

https://docs.cyberark.com/mis-self-hosted/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Credentials-CreatePK.php?TocPath=REST+APIs%7CWeb+SDK+REST%7CCredentials%2C+Identity%2C+and+Permissions+endpoints%7CCredentials+API%7CPOST+Credentials%2FCreate%7C___

https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/add%20account%20v10.htm



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000kSfCAI&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail