Encrypt dotfiles with chezmoi View article history Edit article

Published: , Updated:
Talks about: <a class="post-tag post-tag-chezmoi" href="/tags/chezmoi">chezmoi</a>, <a class="post-tag post-tag-dotfiles" href="/tags/dotfiles">dotfiles</a>, <a class="post-tag post-tag-encryption" href="/tags/encryption">encryption</a>, and <a class="post-tag post-tag-gpg" href="/tags/gpg">gpg</a>

RECOMMENDATION: Use age instead of gpg.

chezmoi can use various external tools to keep data private. gpg is used by various other tools as well, so chances are that you already have a functional setup on your system. To configure gpg with chezmoi, just set yourself as the recipient like this:

  recipient = "[email protected]"

Calling chezmoi add --encrypt /path/to/secret will now create encrypt the file with your public key which allows you to decrypt them later with your private key.