diff options
Diffstat (limited to 'accounts/gkleen@skadhi/rzm/default.nix')
| -rw-r--r-- | accounts/gkleen@skadhi/rzm/default.nix | 74 |
1 files changed, 45 insertions, 29 deletions
diff --git a/accounts/gkleen@skadhi/rzm/default.nix b/accounts/gkleen@skadhi/rzm/default.nix index e2a47362..ce36f0b3 100644 --- a/accounts/gkleen@skadhi/rzm/default.nix +++ b/accounts/gkleen@skadhi/rzm/default.nix | |||
| @@ -176,51 +176,67 @@ 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"; |
| 206 | }; | ||
| 207 | "dhcp01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 208 | Hostname = "dhcp01.mathinst.loc"; | ||
| 209 | User = "root"; | ||
| 210 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; | ||
| 211 | }; | ||
| 212 | "dhcp02" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 213 | Hostname = "dhcp02.mathinst.loc"; | ||
| 214 | User = "root"; | ||
| 215 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; | ||
| 216 | }; | ||
| 217 | "u2w-www01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 218 | Hostname = "u2w-www01.mathinst.loc"; | ||
| 219 | User = "root"; | ||
| 220 | inherit (config.programs.ssh.autosshProxies."mgmt01") ProxyCommand; | ||
| 221 | }; | ||
| 222 | "mail-mi01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 223 | Hostname = "mail-mi01.mathinst.loc"; | ||
| 224 | User = "root"; | ||
| 225 | inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; | ||
| 208 | }; | 226 | }; |
| 209 | "*.mathinst.loc" = { | 227 | "*.mathinst.loc" = { |
| 210 | match = "host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; | 228 | header = "Match host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; |
| 211 | identityFile = "~/.ssh/gkleen@mathinst.loc"; | 229 | IdentityFile = "~/.ssh/gkleen@mathinst.loc"; |
| 212 | extraOptions = { | 230 | HostKeyAlgorithms = "+ssh-rsa"; |
| 213 | HostKeyAlgorithms = "+ssh-rsa"; | 231 | PubkeyAcceptedAlgorithms = "+ssh-rsa"; |
| 214 | PubkeyAcceptedAlgorithms = "+ssh-rsa"; | 232 | PasswordAuthentication = "yes"; |
| 215 | PasswordAuthentication = "yes"; | 233 | GlobalKnownHostsFile = toString (pkgs.writeText "ssh_known_hosts" '' |
| 216 | GlobalKnownHostsFile = toString (pkgs.writeText "ssh_known_hosts" '' | 234 | @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 | 235 | ''); |
| 218 | ''); | ||
| 219 | }; | ||
| 220 | }; | 236 | }; |
| 221 | }; | 237 | }; |
| 222 | 238 | ||
| 223 | services.autosshProxy = { | 239 | programs.ssh.autosshProxies = { |
| 224 | "mgmt01" = { port = 8129; sshpassSecret = "root@mgmt01.mathinst.loc"; }; | 240 | "mgmt01" = { port = 8129; sshpassSecret = "root@mgmt01.mathinst.loc"; }; |
| 225 | "mathw0e" = { port = 8125; sshpassSecret = "gkleen@mathw0e.mathinst.loc"; }; | 241 | "mathw0e" = { port = 8125; sshpassSecret = "gkleen@mathw0e.mathinst.loc"; }; |
| 226 | "mathw0h" = { port = 8123; sshpassSecret = "gkleen@mathw0h.mathinst.loc"; }; | 242 | "mathw0h" = { port = 8123; sshpassSecret = "gkleen@mathw0h.mathinst.loc"; }; |
