ssh nixdesk on public port 2050 prob doesnt work

This commit is contained in:
xunuwu 2025-10-08 10:39:11 +02:00
parent d9b2f62abc
commit 829630944f
Signed by: xun
SSH key fingerprint: SHA256:V3Mr/7NoQDU5RcVlyzUQTuAo3EiCWdg498yk6bfVf7E
2 changed files with 18 additions and 0 deletions

View file

@ -14,6 +14,7 @@
./profiles/wireguard.nix
./profiles/restic-server.nix
./profiles/autologin.nix
./profiles/ssh-public-port-2050.nix
inputs.impermanence.nixosModules.impermanence
inputs.stylix.nixosModules.stylix

View file

@ -0,0 +1,17 @@
{pkgs, ...}: {
# services.openssh.ports = [22 2050];
systemd.services.port2050-natpmp = {
bindsTo = ["sshd"]; # might not work
confinement = {
enable = true;
mode = "chroot-only";
};
serviceConfig.ExecStart = ''
while true
do
${pkgs.libnatpmp}/bin/natpmpc -a 2050 22 tcp 60
sleep 30
done
'';
};
}