From 2e79694285b89e6a287646d3cac2baf4bf8ed078 Mon Sep 17 00:00:00 2001 From: ShatteredMINT Date: Fri, 20 Dec 2024 01:02:08 +0100 Subject: [PATCH] add ssh login for shatteredmint --- backup-target.nix | 13 ------------- configuration.nix | 13 ++++++++++++- users/shatteredmint.nix | 3 +++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/backup-target.nix b/backup-target.nix index d407e43..4333201 100644 --- a/backup-target.nix +++ b/backup-target.nix @@ -15,18 +15,5 @@ ]; }; - services.openssh = { - enable = true; - ports = [ 22 ]; - settings = { - PasswordAuthentication = true; - KbdInteractiveAuthentication = false; - # AllowUsers = [ "backup" ]; - # UseDns = true; - X11Forwarding = false; - PermitRootLogin = "no"; - }; - }; - networking.firewall.allowedTCPPorts = [ 22 ]; } diff --git a/configuration.nix b/configuration.nix index bd4aa90..444db4a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -111,7 +111,18 @@ # List services that you want to enable: # Enable the OpenSSH daemon. - # services.openssh.enable = true; + services.openssh = { + enable = true; + ports = [ 22 ]; + settings = { + PasswordAuthentication = true; + KbdInteractiveAuthentication = false; + # AllowUsers = [ "backup" ]; + # UseDns = true; + X11Forwarding = false; + PermitRootLogin = "no"; + }; + }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; diff --git a/users/shatteredmint.nix b/users/shatteredmint.nix index 784bd19..5c72812 100644 --- a/users/shatteredmint.nix +++ b/users/shatteredmint.nix @@ -8,6 +8,9 @@ isNormalUser = true; extraGroups = [ "wheel" "nixos-admins" ]; shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKT9u43WNMlu3gnu5z9Twt1vkdNdpf6REfEK/OT4qxjK shatteredmint" + ]; };