mirror of
https://github.com/srid/nixos-config.git
synced 2026-07-16 22:01:33 +08:00
route ssh user=pu via socks5 proxy
This commit is contained in:
parent
b3e9d9a89e
commit
682c8327c2
1 changed files with 11 additions and 5 deletions
|
|
@ -43,9 +43,15 @@ in
|
|||
pu
|
||||
];
|
||||
|
||||
# pu writes per-instance ssh_config files under ~/.pu-state/<name>/.
|
||||
# Including them lets `ssh <name>` work directly without `pu connect`.
|
||||
home-manager.users.${flake.config.me.username}.programs.ssh.includes = [
|
||||
"~/.pu-state/*/ssh_config"
|
||||
];
|
||||
# pu writes per-instance ssh_config files under ~/.pu-state/<name>/. Including
|
||||
# them lets `ssh <name>` work directly. The inner ssh those configs spawn goes
|
||||
# to `pu@<PU_HOST>` which is only reachable via vanjaram — route any ssh to
|
||||
# user `pu` through the SOCKS5 proxy.
|
||||
home-manager.users.${flake.config.me.username}.programs.ssh = {
|
||||
includes = [ "~/.pu-state/*/ssh_config" ];
|
||||
matchBlocks."pu-jumphost" = {
|
||||
match = "user pu";
|
||||
proxyCommand = "${pkgs.netcat-openbsd}/bin/nc -X 5 -x 127.0.0.1:${toString socksPort} %h %p";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue