Infini-DL360/ssh: setup X11 Forwarding

This commit is contained in:
Infinidoge 2025-06-02 21:19:50 -04:00
parent 868dd57f61
commit b23d5fdafb
Signed by: Infinidoge
SSH key fingerprint: SHA256:EMoPe5e2dO0gEvtBb2xkZTz5dkyL0rBmuiGTKG5s96E

View file

@ -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