# Cannot add Private Key using flyctl to a environment variable

**URL:** <https://community.fly.io/t/cannot-add-private-key-using-flyctl-to-a-environment-variable/10435>\
**Category:** Questions / Help\
**Created:** [January 30, 2023, 1:45pm UTC](https://community.fly.io/t/cannot-add-private-key-using-flyctl-to-a-environment-variable/10435 "2023-01-30T13:45:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ignoramous](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@ignoramous](https://community.fly.io/u/ignoramous)\
**Post date:** [January 30, 2023, 3:03pm UTC](https://community.fly.io/t/cannot-add-private-key-using-flyctl-to-a-environment-variable/10435/3 "2023-01-30T15:03:06Z")

</div>

> [@CyberX](#):
>
> Searching online hasnt been fruitful.

To add to Greg’s answer, see these two handy tricks to load multi-line values into Fly _secrets_ via `flyctl`:

> [@How are you managing cert files with Fly?](https://community.fly.io/t/how-are-you-managing-cert-files-with-fly/2984/16):
>
> The hyphen means “STDIN until EOF”, a pipe or redirection sets the source and the hyphen instructs where to place it. echo "long text..." | flyctl secrets set LONG\_TEXT=- flyctl secrets set FROM\_A\_FILE=- \< file.txt

* * *

> [@CyberX](#):
>
> =-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BA\nvnwq7Zd3diJpxE46aRQwlJ9LRNitjt2/OUcXkc7AIy7xasAl8c0jADttPpW26Slk\nd/VCCxH7JssXsV8dHvn1Xc3r\n-----END PRIVATE KEY-----\n

I hope this isn’t a private key in actual use. If it is sensitive, rotate it.

---

_[View the full topic](https://community.fly.io/t/cannot-add-private-key-using-flyctl-to-a-environment-variable/10435)._
