From b23d5fdafb04d7b9c1a4e714f26a679a1762b22d Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Mon, 2 Jun 2025 21:19:50 -0400 Subject: [PATCH] Infini-DL360/ssh: setup X11 Forwarding --- hosts/Infini-DL360/ssh.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hosts/Infini-DL360/ssh.nix b/hosts/Infini-DL360/ssh.nix index 70577fa..3b340fd 100644 --- a/hosts/Infini-DL360/ssh.nix +++ b/hosts/Infini-DL360/ssh.nix @@ -61,9 +61,17 @@ in }; }; + environment.systemPackages = with pkgs; [ xorg.xauth ]; + # https://enotacoes.wordpress.com/2021/10/05/limiting-user-to-sshfs-or-sftp-of-one-directory-only/ # https://github.com/NixOS/nixpkgs/blob/d603719ec6e294f034936c0d0dc06f689d91b6c3/nixos/modules/services/networking/ssh/sshd.nix#L663 services.openssh.extraConfig = '' + XAuthLocation ${pkgs.xorg.xauth}/bin/xauth + + Match user infinidoge + X11Forwarding yes + X11UseLocalhost no + Match user incoming AuthorizedKeysFile /etc/ssh/authorized_keys.d/infinidoge /etc/ssh/authorized_keys.d/%u ChrootDirectory /srv/external