# How to RSA Keys for IAX2 and DUNDi

**URL:** <https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489>\
**Category:** Asterisk Support\
**Created:** [January 3, 2026, 1:32pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489 "2026-01-03T13:32:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hb9eue](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/hb9eue/32/7247_2.png) [@hb9eue](https://community.asterisk.org/u/hb9eue)\
**Post date:** [January 3, 2026, 1:32pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/1 "2026-01-03T13:32:05Z")

</div>

After upgrading to Asterisk 22 on Debian ‘sid’ I am having troubles with RSA keys.

I created the keys with astgenkey -n copied them to /var/lib/asterisk/keys, made sure they have correct ownership and permissions.

Double checked the manpage and documentation, restarted asterisk

Sill ‘show keys’ does not show any keys.

Any hints what I could be doing wrong?

---

<div class="post-metadata">

**Author:** ![hb9eue](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/hb9eue/32/7247_2.png) [@hb9eue](https://community.asterisk.org/u/hb9eue)\
**Post date:** [January 3, 2026, 2:19pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/2 "2026-01-03T14:19:37Z")

</div>

Found solution. Manpage (and many other documentation) is wrong about the key location.

> [@RSA Keys don't load](https://community.asterisk.org/t/rsa-keys-dont-load/108439/2):
>
> Put them in /usr/share/asterisk/keys Le 20/05/2025 à 03:17, edgreenberg via Asterisk Community a écrit : [edgreenberg] edgreenberg [https://community.asterisk.org/u/edgreenberg](https://community.asterisk.org/u/edgreenberg) May 20 I have an Asterisk instance of 20.6.0~dfsg+~cs6.13.40431414-2build5 as installed from the Ubuntu repos on 24.04. I’m trying to load an RSA key. I created it with |astgenkey -q -n phreaknetrsa| and wound up with keys in |/var/lib/asterisk/keys|. But wait, Ubuntu’s package, in asterisk.conf, contains: |astk…

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [January 3, 2026, 2:36pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/3 "2026-01-03T14:36:16Z")

</div>

On Saturday 03 January 2026 at 14:42:46, hb9eue via Asterisk Community wrote:

> After upgrading to Asterisk 22 on Debian ‘sid’ I am having troubles with  
> RSA keys.

On Saturday 03 January 2026 at 15:30:14, hb9eue via Asterisk Community wrote:

> Found solution. Manpage (and many other documentation) is wrong about the  
> key location.

I would say that this is connected to the word “Debian” above.

Debian often puts files (not only for Asterisk, but many other applications  
too) where _Debian_ wants them to be, which is not necessarily the same as  
where the application developers thought they should be.

It all works, each system is self-consistent, but they’re not directly  
compatible.

Antony.

–  
Software development can be quick, high quality, or low cost.

The customer gets to pick any two out of three.

---

<div class="post-metadata">

**Author:** ![Rob](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Rob](https://community.asterisk.org/u/Rob)\
**Post date:** [January 4, 2026, 10:32am UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/4 "2026-01-04T10:32:25Z")

</div>

Hi there

Try to find a config statement which sets the location for your keys. That way you can out them wherever you want. I have mine in /etc/asterisk/.

Regards,  
Rob

---

<div class="post-metadata">

**Author:** ![hb9eue](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/hb9eue/32/7247_2.png) [@hb9eue](https://community.asterisk.org/u/hb9eue)\
**Post date:** [January 5, 2026, 11:48am UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/5 "2026-01-05T11:48:39Z")

</div>

Thank you, I also submitted a debian bugreport about this and learned this is configurable, but strange is:

asterisk.conf =\> astkeydir points to /var/lib/asterisk/ - but still keys are loaded from /usr/share/asterisk/keys/ maybe this config value should point to /var/lib/asterisk/keys/ ?

-Benoît-

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 5, 2026, 12:01pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/6 "2026-01-05T12:01:08Z")

</div>

What is the actual complete contents of asterisk.conf? By default it’s a template, which means it is not actually loaded.

---

<div class="post-metadata">

**Author:** ![hb9eue](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/hb9eue/32/7247_2.png) [@hb9eue](https://community.asterisk.org/u/hb9eue)\
**Post date:** [January 5, 2026, 1:38pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/7 "2026-01-05T13:38:08Z")

</div>

Indeed, it is a template:

`[directories](!)`  
astcachedir =\> /var/cache/asterisk  
astetcdir =\> /etc/asterisk  
astmoddir =\> /usr/lib/x86\_64-linux-gnu/asterisk/modules  
astvarlibdir =\> /var/lib/asterisk  
astdbdir =\> /var/lib/asterisk  
astkeydir =\> /var/lib/asterisk  
astdatadir =\> /usr/share/asterisk  
astagidir =\> /usr/share/asterisk/agi-bin  
astspooldir =\> /var/spool/asterisk  
astrundir =\> /var/run/asterisk  
astlogdir =\> /var/log/asterisk  
astsbindir =\> /usr/sbin

And it is not applied to any other `[section](directories)`

This seems to be the debian specific patch to alter the directory:

> **[File: 2010\_astdatadir.patch
| Debian Sources](https://sources.debian.org/src/asterisk/1%3A22.7.0~dfsg%2B~cs6.15.60671435-1/debian/patches/2010_astdatadir.patch)**

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [February 4, 2026, 1:38pm UTC](https://community.asterisk.org/t/how-to-rsa-keys-for-iax2-and-dundi/111489/8 "2026-02-04T13:38:09Z")

</div>

Closed on February 4, 2026, 1:38pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
