From a7b26a08d1d8ce39ff2d2f0961358a7a107f189a Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Fri, 15 Mar 2024 20:32:22 +0100 Subject: [PATCH] add default password to server config --- hosts/default/configuration.nix | 4 ++-- hosts/server/configuration.nix | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 2ef0aef..3fc38b5 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -174,8 +174,8 @@ }; # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 5909 ]; - networking.firewall.allowedUDPPorts = [ 5909 ]; + # networking.firewall.allowedTCPPorts = [ 5909 ]; + # networking.firewall.allowedUDPPorts = [ 5909 ]; # Or disable the firewall altogether. # networking.firewall.enable = false; diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index da61a9b..c575420 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -60,16 +60,24 @@ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.noa = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - firefox - tree - ]; - openssh.authorizedKeys.keys = [ + users.users = { + root = { + openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWtje7dGqyrBY7PLq6DANvUR6yfungQNsXGkTO6PP6/ noa@NoasPCArch" - ]; + ]; + }; + noa = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + firefox + tree + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWtje7dGqyrBY7PLq6DANvUR6yfungQNsXGkTO6PP6/ noa@NoasPCArch" + ]; + hashedPassword = "$y$j9T$Essu0/awyRr6Z8PfSlYod.$B.TZp3vh4t84NAgEhLDJ5E8ESbPao/X8uqrU/E.xxr4"; + }; }; # Allow unfree packages