Ssh : Persist for all connections.

This commit is contained in:
Dmitry Voronin 2024-08-24 17:41:18 +03:00
parent aaf75debdc
commit fdff73c645
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -1,25 +1,27 @@
# SSH client configuration. # SSH client configuration.
{ util, ... }: let { util, ... }: let
mkHost = name: address: port: user: extra: util.trimTabs '' mkHost = name: address: port: user: extra: ''
Host ${name} Host ${name}
HostName ${address} HostName ${address}
User ${user} User ${user}
Port ${toString port} Port ${toString port}
ControlPath ~/.ssh/${name}.socket
ControlMaster auto
ControlPersist yes
'' + extra; '' + extra;
in { in {
text = "" text = util.trimTabs (''
+ mkHost "dasha" "10.0.0.7" 22143 "root" "" Host *
+ mkHost "desktop" "10.0.0.3" 22143 "root" "" ControlMaster auto
+ mkHost "fmpmaven" "10.30.22.10" 22 "root" "" ControlPath ~/.ssh/%r@%h:%p
+ mkHost "home" "10.0.0.1" 22143 "root" "" ControlPersist yes
+ mkHost "laptop" "192.168.1.9" 22143 "root" "" ''
+ mkHost "pi" "192.168.1.6" 22143 "root" "" + mkHost "dasha" "10.0.0.7" 22143 "root" ""
+ mkHost "vpn" "194.113.233.38" 22143 "root" "" + mkHost "desktop" "10.0.0.3" 22143 "root" ""
+ mkHost "work" "192.168.1.5" 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"
; );
} }