From 2c7e31c431b69ea86a38677c6b4cee4c9c07816b Mon Sep 17 00:00:00 2001 From: Veneficium <85629831+veneficium42@users.noreply.github.com> Date: Sat, 3 Aug 2024 11:56:49 +0200 Subject: [PATCH] update: work on pam and ssh for main-homelab --- hosts/main-homelab/configuration.nix | 33 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/hosts/main-homelab/configuration.nix b/hosts/main-homelab/configuration.nix index 92536e1..8632ec2 100644 --- a/hosts/main-homelab/configuration.nix +++ b/hosts/main-homelab/configuration.nix @@ -25,10 +25,33 @@ networking.networkmanager.enable = true; - # Set your time zone. + services.openssh = { + enable = true; + ports = [ 12342 ]; + settings = { + PasswordAuthentication = true; + AllowUsers = null; + UsePAM = true; + X11Forwarding = false; + PermitRootLogin = "prohibit-password"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no" + }; + }; + + security.pam = { + services.sshd = { + name = "sshd"; + googleAuthenticator.enable = true; + gnupg.enable = true; + }; + }; + + services.endlessh-go = { + enable = true; + port = 22; + }; + time.timeZone = "Europe/Rome"; - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; i18n.extraLocaleSettings = { @@ -43,14 +66,12 @@ LC_TIME = "it_IT.UTF-8"; }; - # Configure keymap in X11 services.xserver.xkb = { layout = "it"; variant = ""; }; - # Configure console keymap - console.keyMap = "it2"; + console.keyMap = "it"; environment.systemPackages = with pkgs; [ nano @@ -72,8 +93,6 @@ programs.zsh.enable = true; - services.openssh.enable = true; - # Allow unfree packages nixpkgs.config.allowUnfree = true;