!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

322 Members
age-encrypted secrets for NixOS https://github.com/ryantm/agenix/94 Servers

Load older messages


SenderMessageTime
8 Mar 2025
@k900:0upti.meK900Not your user key07:07:19
@laurent:matrix.fdn.frlaurent
In reply to @k900:0upti.me
You don't want any password prompts at all?
I dont want a password prompt hanging on the boot sequence as it freezes my machine, and the "asking for password prompt" is hidden behind the nixos booting logo. Im used to only have one ssh key with other linux distrib,so i prob didnt setup things properly by having the same key for host and user. Ill investigate!
07:16:23
@k900:0upti.meK900The host key is not something you need to manually create07:16:52
@k900:0upti.meK900 It's created when you start sshd for the first time, in /etc/ssh/sshhostkey_ed25519 07:17:05
@laurent:matrix.fdn.frlaurentAhh thx, i wasnt even aware of this folder! I put my key in my ~/.ssh as for other linux! 07:20:11
@k900:0upti.meK900Those are different keys07:20:23
@k900:0upti.meK900Your key in ~/.ssh identifies your user07:20:28
@k900:0upti.meK900The host key in /etc/ssh identifies the machine07:20:35
@laurent:matrix.fdn.frlaurentGot it! And when i set up agenix i encrypted with my user key, which i then use in the identityfile option of agenix! So i should have encrypted with the host machine correct? But this host ssh key is automatically regenerated on a new nixos install?07:25:13
@k900:0upti.meK900You encrypt with the public part of the host key07:25:36
@k900:0upti.meK900And then it's decrypted with the private part07:25:43
@laurent:matrix.fdn.frlaurent* Got it! And when i set up agenix, i encrypted with my user key, which i then use in the identityfile option of agenix! So i should have encrypted with the host machine correct? But this host ssh key is automatically regenerated on a new nixos install?07:25:45
@k900:0upti.meK900And yes, the host key is generated per machine07:25:48
@k900:0upti.meK900 So you probably want to also encrypt to your own user key, so you can access the secrets if you don't have any of the host keys 07:26:06
@laurent:matrix.fdn.frlaurentThx! I did everything the wrong way then. So the host key needs obviously to be backed up. I ll check some doc to see how to reinstall it the nix way on a fresh install.thx a lot fornyour help07:29:13
@Valodim:stratum0.orgValodimIt does not need to be backed up. Just create a new one and rekey on redeployment07:49:26
@laurent:matrix.fdn.frlaurent
In reply to @Valodim:stratum0.org
It does not need to be backed up. Just create a new one and rekey on redeployment
Do you mean to re encrypt all secrets with the then new host key?
08:13:45
@Valodim:stratum0.orgValodimYes08:14:05
@Valodim:stratum0.orgValodimThe same as you'll have to do on other occasions when public keys changes, e.g. when some secret should be available for a new host08:14:57
@Valodim:stratum0.orgValodim Maybe study the agenix docs some more. it's in there :) 08:15:13
@laurent:matrix.fdn.frlaurent
In reply to @Valodim:stratum0.org
Maybe study the agenix docs some more. it's in there :)
I reckon thats what i have to do haha. Been wanting to take shortcuts with nix to be able to have a quick working env but its time to go back to the doc now that i understand more the ecosystem
08:17:33
@qyriad:katesiria.orgQyriad changed their display name from qyriad to Qyriad.21:41:03
9 Mar 2025
@kiwicutter:matrix.orgkiwicutter joined the room.23:34:49
10 Mar 2025
@kiwicutter:matrix.orgkiwicutterSo, ive been using agenix for a bit and only now thought to myself hey, maybe i should check how (easily) recreating my system actually is in case i ever need to do so. The issue i ran into was, of course, that the install media can't decrypt any secrets during nixos-install. Is there a way to supply a user or a previous host key to that or do i have to re-key everything?00:01:46
@Valodim:stratum0.orgValodimPersonally I find it's easiest to deploy a relatively blank nixos (e.g. just disk config), rekey, then do the full in install. Doesn't hurt to have new host keys once in a while, but ymmv06:35:11
@danielo515:matrix.orgDaniel Rodríguez RiveroIf that is the intended usage, would not be SOPS simpler? It will work fine without the secrets, then you put them and run again to get the data decryted for real08:19:45
@Valodim:stratum0.orgValodimagenix also "works fine" without secrets, the secret files just won't be there 🤷08:25:52
@danielo515:matrix.orgDaniel Rodríguez Riverothen you don't need a relatively blank anything, no?08:28:16
@danielo515:matrix.orgDaniel Rodríguez Riverojust don't depend on secrets for your system to function08:28:33
@Valodim:stratum0.orgValodimmaybe I just misunderstood what you meant by "sops will work fine without the secrets". I'd think it behaves very similar to agenix in this regard08:33:54

Show newer messages


Back to Room ListRoom Version: 6