2021-01-30 19:22:04 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2021-08-27 23:11:59 +00:00
|
|
|
# Make sure controlPath directory exists
|
|
|
|
home.file.".ssh/c/.dummy".text = "";
|
2021-01-30 19:22:04 +00:00
|
|
|
programs.ssh = {
|
|
|
|
enable = true;
|
|
|
|
controlMaster = "auto";
|
2021-08-27 23:11:59 +00:00
|
|
|
controlPersist = "10m";
|
|
|
|
controlPath = "~/.ssh/c/%r@%n:%p";
|
|
|
|
# We have to do this as text to gaurantee it's part of the last Host * block
|
2021-09-18 17:08:41 +00:00
|
|
|
userKnownHostsFile = "~/.ssh/known_hosts ${./extra_known_hosts}";
|
2021-08-27 23:11:59 +00:00
|
|
|
extraConfig = ''
|
2022-08-30 16:15:54 +00:00
|
|
|
KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
|
|
|
|
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com
|
2022-04-26 21:00:09 +00:00
|
|
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
2022-08-30 16:24:39 +00:00
|
|
|
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-256,rsa-sha2-512
|
2022-04-26 21:00:09 +00:00
|
|
|
VerifyHostKeyDNS ask
|
|
|
|
VisualHostKey yes
|
|
|
|
UpdateHostKeys ask
|
2021-08-27 23:11:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Most hosts are set in private
|
|
|
|
matchBlocks = {
|
|
|
|
"github.com".extraOptions.ControlMaster = "no";
|
|
|
|
};
|
2021-01-30 19:22:04 +00:00
|
|
|
};
|
|
|
|
}
|