From fdff73c645fa7e111641e8095f673b163dde42df Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 24 Aug 2024 17:41:18 +0300 Subject: [PATCH] Ssh : Persist for all connections. --- home/config/ssh/default.nix | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/home/config/ssh/default.nix b/home/config/ssh/default.nix index 1b397495..d8f52455 100644 --- a/home/config/ssh/default.nix +++ b/home/config/ssh/default.nix @@ -1,25 +1,27 @@ # SSH client configuration. { util, ... }: let - mkHost = name: address: port: user: extra: util.trimTabs '' + mkHost = name: address: port: user: extra: '' Host ${name} HostName ${address} User ${user} Port ${toString port} - ControlPath ~/.ssh/${name}.socket - ControlMaster auto - ControlPersist yes '' + extra; in { - text = "" - + mkHost "dasha" "10.0.0.7" 22143 "root" "" - + mkHost "desktop" "10.0.0.3" 22143 "root" "" - + mkHost "fmpmaven" "10.30.22.10" 22 "root" "" - + mkHost "home" "10.0.0.1" 22143 "root" "" - + mkHost "laptop" "192.168.1.9" 22143 "root" "" - + mkHost "pi" "192.168.1.6" 22143 "root" "" - + mkHost "vpn" "194.113.233.38" 22143 "root" "" - + mkHost "work" "192.168.1.5" 22143 "root" "" + text = util.trimTabs ('' + Host * + ControlMaster auto + ControlPath ~/.ssh/%r@%h:%p + ControlPersist yes + '' + + mkHost "dasha" "10.0.0.7" 22143 "root" "" + + mkHost "desktop" "10.0.0.3" 22143 "root" "" + + mkHost "fmpmaven" "10.30.22.10" 22 "root" "" + + mkHost "home" "10.0.0.1" 22143 "root" "" + + mkHost "laptop" "192.168.1.9" 22143 "root" "" + + mkHost "pi" "192.168.1.6" 22143 "root" "" + + mkHost "vpn" "194.113.233.38" 22143 "root" "" + + mkHost "work" "192.168.1.5" 22143 "root" "" - + mkHost "nixbuilder" "10.0.0.1" "22143" "nixbuilder" " StrictHostKeyChecking=accept-new" - ; + + mkHost "nixbuilder" "10.0.0.1" 22143 "nixbuilder" " StrictHostKeyChecking=accept-new" + ); }