[Nix-dev] [PATCH] authorized_keys in users.extraUsers

Rickard Nilsson rickard.nilsson at telia.com
Sun Oct 16 21:28:54 CEST 2011


Hi,

I've written a patch to users-groups.nix that allows me to specify the  
contents of a users ~/.ssh/authorized_keys file like this:


   users.extraUsers = [
     { name = "myuser";
       description = "";
       group = "users";
       home = "/home/myuser";
       createHome = true;
       useDefaultShell = true;
       authorizedKeyFiles = [
         "/etc/secrets/someotheruser.id_dsa.pub"
       ];
     }
   ];


I can also specify keys directly with the authorizedKeys attribute,  
instead of referring files. If there are existing keys in authorized_keys  
they will be left alone.

Is this something that others find useful? Does it make sense to put it in  
users.extraUsers, or is it too messy? Maybe there is a place for a more  
general home.<username>.authorizedKeys configuration? What do you think?


Best regards,
   Rickard Nilsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: users-groups.patch
Type: application/octet-stream
Size: 3075 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20111016/e8425b17/attachment.obj 


More information about the nix-dev mailing list