commit ab24ca44722b5c50ca7414d311f5288ed539a408 parent dc236c38ad0994243a0a6179f3ee86ae66a95e16 Author: breadcat <breadcat@users.noreply.github.com> Date: Thu, 16 Oct 2025 19:15:04 +0100 False default config for SSH Diffstat:
| M | home/ssh.nix | | | 105 | ++++++++++++++++++++++++++++++++++++++++++++----------------------------------- |
1 file changed, 59 insertions(+), 46 deletions(-)
diff --git a/home/ssh.nix b/home/ssh.nix @@ -1,51 +1,64 @@ { domain, username, sshport, privatekey, ... }: { - programs.ssh = { - enable = true; - matchBlocks = { - "tunnel" = { - hostname = "${domain}"; - user = "${username}"; - port = sshport; - identityFile = "${privatekey}"; - extraOptions = { - RemoteCommand = "ssh -p 55013 ${username}@localhost -i ${privatekey}"; - RequestTTY = "force"; - }; - }; - "arcadia" = { - hostname = "192.168.1.6"; - user = "${username}"; - port = 22; - identityFile = "${privatekey}"; - }; - "ilias" = { - hostname = "192.168.1.3"; - user = "${username}"; - port = 22; - identityFile = "${privatekey}"; - }; - "router" = { - hostname = "192.168.1.1"; - user = "root"; - port = 22; - }; - "ap" = { - hostname = "192.168.1.2"; - user = "root"; - port = 22; - extraOptions = { - HostKeyAlgorithms = "+ssh-rsa"; - }; - }; - "artemis" = { - hostname = "${domain}"; - user = "${username}"; - port = sshport; - identityFile = "${privatekey}"; - }; - }; - }; + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + "*" = { + forwardAgent = false; + addKeysToAgent = "no"; + compression = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = "no"; + }; + "tunnel" = { + hostname = "${domain}"; + user = "${username}"; + port = sshport; + identityFile = "${privatekey}"; + extraOptions = { + RemoteCommand = "ssh -p 55013 ${username}@localhost -i ${privatekey}"; + RequestTTY = "force"; + }; + }; + "arcadia" = { + hostname = "192.168.1.6"; + user = "${username}"; + port = sshport; + identityFile = "${privatekey}"; + }; + "ilias" = { + hostname = "192.168.1.3"; + user = "${username}"; + port = sshport; + identityFile = "${privatekey}"; + }; + "router" = { + hostname = "192.168.1.1"; + user = "root"; + port = 22; + }; + "ap" = { + hostname = "192.168.1.2"; + user = "root"; + port = 22; + extraOptions = { + HostKeyAlgorithms = "+ssh-rsa"; + }; + }; + "artemis" = { + hostname = "${domain}"; + user = "${username}"; + port = sshport; + identityFile = "${privatekey}"; + }; + }; + }; }