
# Invalid privatekey error when publishing via SFTP

> Cascade CMS needs the SSH key in PEM format. Regenerate the key pair with ssh-keygen -m PEM and upload it again.

URL: https://www.hannonhill.com/cascadecms/latest/articles/content-authoring/publishing/invalid-privatekey-error-when-publishing-via-sftp.html
category: Content Authoring
article-type: troubleshooting
content-kind: faq
release-availability: all
tags: publishing, errors, security
updated: 2026-10-06

When using SSH Key authentication for SFTP [Transports](https://www.hannonhill.com/cascadecms/latest/articles/content-authoring/publishing/transports.html), you may see the following error when testing the Transport or when publishing to a Destination that uses it:

```bash
SFTP error occurred during SFTP Shuttle initialization: invalid privatekey: [x@xxxxxxx
```

To resolve it, upload your SSH key in PEM format. A command like the following produces a valid key pair in that format:

```bash
ssh-keygen -t rsa -m PEM
```

For more on the `ssh-keygen` command, see [ssh.com's keygen reference](https://www.ssh.com/academy/ssh/keygen).
