Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647# OpenSSH with its client configuration named by -F. Claude Desktop runs# sessions in a user namespace that shows store files, including Home# Manager's ~/.ssh/config link, as owned by `nobody`, and ssh rejects a user# config it does not own; -F skips only that ownership check. The sandbox# also hides host /etc/ssh, so the system config is included rather than# relied on, and ssh ignores the include when the file is missing.{ lib, pkgs }:
let wrapWithConfig = import ../../lib/wrap-with-config.nix { inherit lib pkgs; }; tangledKey = "/home/schlich/.ssh/id_ed25519_tangled"; # Hosts without the dedicated key, such as homelab, authenticate to Tangled # with their default key; ssh skips whichever file is missing. defaultKey = "/home/schlich/.ssh/id_ed25519";inwrapWithConfig { package = pkgs.openssh; programs = [ "ssh" "scp" "sftp" ]; flags = [ "-F" (pkgs.writeText "ssh_config" '' Host tangled.org HostName tangled.org User git IdentityFile ${tangledKey} IdentityFile ${defaultKey} IdentitiesOnly yes AddressFamily inet
# homelab's sudo accepts this key from the forwarded agent. Forward it # only here: root on the far end can use the agent while connected. Host homelab IdentityFile ${tangledKey} IdentitiesOnly yes ForwardAgent yes
Host * AddKeysToAgent yes Include /etc/ssh/ssh_config '') ];}