Remote disk unlocking: Difference between revisions

34j (talk | contribs)
Add setup for systemd based initrd
34j (talk | contribs)
mNo edit summary
Line 18: Line 18:
3. Configure {{nixos:option|boot.initrd.network.ssh}}. Add the generated host key to {{nixos:option|boot.initrd.network.ssh.hostKeys}} and your public key to {{nixos:option|boot.initrd.network.ssh.authorizedKeys}}.
3. Configure {{nixos:option|boot.initrd.network.ssh}}. Add the generated host key to {{nixos:option|boot.initrd.network.ssh.hostKeys}} and your public key to {{nixos:option|boot.initrd.network.ssh.authorizedKeys}}.


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>boot.initrd.network = {
boot.initrd.network = {
   enable = true;
   enable = true;
   ssh = {
   ssh = {
Line 63: Line 62:
To configure DHCP:
To configure DHCP:


{{file|/etc/nixos/configuration.nix|nix|3=boot.initrd.systemd.network = {
{{file|/etc/nixos/configuration.nix|nix|3=<nowiki>
boot.initrd.systemd.network = {
   enable = true;
   enable = true;
   networks."10-eth0" = {
   networks."10-eth0" = {
Line 72: Line 72:
     linkConfig.RequiredForOnline = "routable";
     linkConfig.RequiredForOnline = "routable";
   };
   };
};|name=/etc/nixos/configuration.nix|lang=nix}}
};</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}


To configure static IP:
To configure static IP:
Line 94: Line 94:
   };
   };
};
};
</nowiki>}}


3. To automatically be prompted for a password when logging in via SSH, add <code>command="systemctl default"</code> to {{nixos:option|boot.initrd.network.ssh.authorizedKeys}}.
3. To automatically be prompted for a password when logging in via SSH, add <code>command="systemctl default"</code> to {{nixos:option|boot.initrd.network.ssh.authorizedKeys}}.