diff options
Diffstat (limited to 'accounts/gkleen@skadhi/rzm/default.nix')
| -rw-r--r-- | accounts/gkleen@skadhi/rzm/default.nix | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/accounts/gkleen@skadhi/rzm/default.nix b/accounts/gkleen@skadhi/rzm/default.nix index e2a47362..cea4a58a 100644 --- a/accounts/gkleen@skadhi/rzm/default.nix +++ b/accounts/gkleen@skadhi/rzm/default.nix | |||
| @@ -176,51 +176,47 @@ in { | |||
| 176 | pro = "$HOME/projects/pro"; | 176 | pro = "$HOME/projects/pro"; |
| 177 | }; | 177 | }; |
| 178 | 178 | ||
| 179 | programs.ssh.matchBlocks = let | 179 | programs.ssh.settings = { |
| 180 | autosshProxy = host: "${lib.getExe pkgs.socat} - SOCKS4A:127.0.0.1:%h:%p,socksport=${toString config.services.autosshProxy.${host}.port}"; | ||
| 181 | in { | ||
| 182 | "repo-apt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | 180 | "repo-apt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { |
| 183 | user = "root"; | 181 | User = "root"; |
| 184 | hostname = "repo-apt01.mathinst.loc"; | 182 | Hostname = "repo-apt01.mathinst.loc"; |
| 185 | proxyCommand = autosshProxy "mgmt01"; | 183 | inherit (config.programs.ssh.autosshProxies."mgmt01") ProxyCommand; |
| 186 | }; | 184 | }; |
| 187 | "mgmt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | 185 | "mgmt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { |
| 188 | user = "root"; | 186 | User = "root"; |
| 189 | hostname = "mgmt01.mathinst.loc"; | 187 | Hostname = "mgmt01.mathinst.loc"; |
| 190 | proxyCommand = autosshProxy "mathw0h"; | 188 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; |
| 191 | }; | 189 | }; |
| 192 | "mathw0e" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | 190 | "mathw0e" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { |
| 193 | hostname = "mathw0e.mathinst.loc"; | 191 | Hostname = "mathw0e.mathinst.loc"; |
| 194 | proxyCommand = autosshProxy "mathw0h"; | 192 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; |
| 195 | }; | 193 | }; |
| 196 | "cip04" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | 194 | "cip04" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { |
| 197 | hostname = "cip04.cipmath.loc"; | 195 | Hostname = "cip04.cipmath.loc"; |
| 198 | proxyCommand = autosshProxy "mathw0h"; | 196 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; |
| 199 | }; | 197 | }; |
| 200 | "mathw0h" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | 198 | "mathw0h" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { |
| 201 | hostname = "mathw0h.mathinst.loc"; | 199 | Hostname = "mathw0h.mathinst.loc"; |
| 202 | proxyCommand = autosshProxy "ssh.math.lmu.de"; | 200 | inherit (config.programs.ssh.autosshProxies."ssh.math.lmu.de") ProxyCommand; |
| 203 | }; | 201 | }; |
| 204 | "math05" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | 202 | "math05" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { |
| 205 | hostname = "math05.mathinst.loc"; | 203 | Hostname = "math05.mathinst.loc"; |
| 206 | proxyCommand = autosshProxy "mathw0h"; | 204 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; |
| 207 | extraOptions.KexAlgorithms = "+diffie-hellman-group1-sha1"; | 205 | KexAlgorithms = "+diffie-hellman-group1-sha1"; |
| 208 | }; | 206 | }; |
| 209 | "*.mathinst.loc" = { | 207 | "*.mathinst.loc" = { |
| 210 | match = "host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; | 208 | header = "Host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; |
| 211 | identityFile = "~/.ssh/gkleen@mathinst.loc"; | 209 | IdentityFile = "~/.ssh/gkleen@mathinst.loc"; |
| 212 | extraOptions = { | 210 | HostKeyAlgorithms = "+ssh-rsa"; |
| 213 | HostKeyAlgorithms = "+ssh-rsa"; | 211 | PubkeyAcceptedAlgorithms = "+ssh-rsa"; |
| 214 | PubkeyAcceptedAlgorithms = "+ssh-rsa"; | 212 | PasswordAuthentication = "yes"; |
| 215 | PasswordAuthentication = "yes"; | 213 | GlobalKnownHostsFile = toString (pkgs.writeText "ssh_known_hosts" '' |
| 216 | GlobalKnownHostsFile = toString (pkgs.writeText "ssh_known_hosts" '' | 214 | @cert-authority *.mathinst.loc,*.math.lmu.de,*.cipmath.loc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUTFpVCdETCXiDSDl7YGbR1J4BLTsoBzjDtflHJGO/z ssh-pki@mgmt01 |
| 217 | @cert-authority *.mathinst.loc,*.math.lmu.de,*.cipmath.loc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUTFpVCdETCXiDSDl7YGbR1J4BLTsoBzjDtflHJGO/z ssh-pki@mgmt01 | 215 | ''); |
| 218 | ''); | ||
| 219 | }; | ||
| 220 | }; | 216 | }; |
| 221 | }; | 217 | }; |
| 222 | 218 | ||
| 223 | services.autosshProxy = { | 219 | programs.ssh.autosshProxies = { |
| 224 | "mgmt01" = { port = 8129; sshpassSecret = "root@mgmt01.mathinst.loc"; }; | 220 | "mgmt01" = { port = 8129; sshpassSecret = "root@mgmt01.mathinst.loc"; }; |
| 225 | "mathw0e" = { port = 8125; sshpassSecret = "gkleen@mathw0e.mathinst.loc"; }; | 221 | "mathw0e" = { port = 8125; sshpassSecret = "gkleen@mathw0e.mathinst.loc"; }; |
| 226 | "mathw0h" = { port = 8123; sshpassSecret = "gkleen@mathw0h.mathinst.loc"; }; | 222 | "mathw0h" = { port = 8123; sshpassSecret = "gkleen@mathw0h.mathinst.loc"; }; |
