From 2039fd8cb6708128a956861955934652ab3c176f Mon Sep 17 00:00:00 2001 From: arcnmx Date: Tue, 6 Feb 2024 13:26:20 -0800 Subject: [PATCH] fix(hakurei): ssh access --- nixos/base/ssh.nix | 2 +- systems/hakurei/reisen-ssh.nix | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/base/ssh.nix b/nixos/base/ssh.nix index f2fbee17..f2a587dc 100644 --- a/nixos/base/ssh.nix +++ b/nixos/base/ssh.nix @@ -15,7 +15,7 @@ in { services.openssh = { enable = mkDefault true; - ports = mkDefault [publicPort 22]; + ports = [publicPort 22]; openFirewall = mkDefault false; settings = { PasswordAuthentication = mkDefault false; diff --git a/systems/hakurei/reisen-ssh.nix b/systems/hakurei/reisen-ssh.nix index 44b59f12..bae07168 100644 --- a/systems/hakurei/reisen-ssh.nix +++ b/systems/hakurei/reisen-ssh.nix @@ -5,6 +5,7 @@ ... }: let inherit (lib.modules) mkAfter; + sshPort = 41022; username = "tf-proxmox"; sshJump = pkgs.writeShellScript "ssh-jump-${username}" '' exec ssh -T \ @@ -18,7 +19,9 @@ in { hashedPasswordFile = config.sops.secrets.tf-proxmox-passwd.path; isNormalUser = true; }; + services.openssh = { + ports = mkAfter [ sshPort ]; settings = { KbdInteractiveAuthentication = true; PasswordAuthentication = true; @@ -28,6 +31,9 @@ in { ForceCommand ${sshJump} ''; }; + + networking.firewall.allowedTCPPorts = [ sshPort ]; + sops.secrets = { tf-proxmox-passwd = { }; tf-proxmox-identity = {