# Generating Authorized Keys Files with Doppler

**URL:** https://community.doppler.com/t/generating-authorized-keys-files-with-doppler/217
**Category:** Show & Tell
**Created:** [May 6, 2021, 5:08am UTC](https://community.doppler.com/t/generating-authorized-keys-files-with-doppler/217 "2021-05-06T05:08:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![avaitla16](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/avaitla16/32/136_2.png) [@avaitla16](https://community.doppler.com/u/avaitla16)
#### Post date: [May 6, 2021, 5:08am UTC](https://community.doppler.com/t/generating-authorized-keys-files-with-doppler/217/1 "2021-05-06T05:08:39Z")

</div>

Here’s a cool little trick for generating authorized keys files with doppler. Create configs as follows for each team member you need to give access to:

 ![Screen Shot 2021-05-06 at 12.09.50 AM](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/1X/34dae5e7e13a93fee77b43e90f855863395ee944.png)

Now you can run the following:

```auto
doppler run -- printenv | grep SSH_AUTH_KEY | cut -d"=" -f2 > authorized_keys && chmod 600 authorized_keys

```

You can even run this on a crontab once an hour or so if you’d prefer to do so or just run it manually as needed.

---

<div class="post-metadata">

### Author: ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)
#### Post date: [May 6, 2021, 5:17am UTC](https://community.doppler.com/t/generating-authorized-keys-files-with-doppler/217/2 "2021-05-06T05:17:42Z")

</div>

You can even simplify this further using `doppler secrets get`:

```bash
doppler secrets get SSH_AUTH_KEY_ANIL --plain > authorized_keys && chmod 600 authorized_keys

```

---

<div class="post-metadata">

### Author: ![avaitla16](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/avaitla16/32/136_2.png) [@avaitla16](https://community.doppler.com/u/avaitla16)
#### Post date: [May 6, 2021, 5:38am UTC](https://community.doppler.com/t/generating-authorized-keys-files-with-doppler/217/3 "2021-05-06T05:38:01Z")

</div>

Interesting are you stuffing it all into one big json in your case?  
I was thinking every ssh key has its own variable and you’d have to do the following for each key:

```auto
doppler secrets get SSH_AUTH_KEY_* -c dev -p ... --plain

```

Are wildcard fetches like that supported?

---

<div class="post-metadata">

### Author: ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)
#### Post date: [May 6, 2021, 6:15am UTC](https://community.doppler.com/t/generating-authorized-keys-files-with-doppler/217/4 "2021-05-06T06:15:34Z")

</div>

Ahh my bad, I see now your script iterates through every key with the `SSH_AUTH_KEY` prefix. Neat!

Your solution is a good one and I’ve added it to a newly created [Secrets Access page](https://docs.doppler.com/docs/accessing-secrets) in our docs.
