fix: set identitiesOnly for ssh hosts to prevent auth failure

This commit is contained in:
Youwen Wu 2024-12-28 01:17:48 -08:00
parent 83a8eaa2c6
commit 4d96d98780
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -24,6 +24,7 @@
}; };
}; };
# must set identitiesOnly since we are adding a ton of SSH keys to ssh-agent and it tries all of them
programs.ssh = { programs.ssh = {
enable = true; enable = true;
matchBlocks = { matchBlocks = {
@ -31,19 +32,23 @@
host = "code.youwen.dev"; host = "code.youwen.dev";
# port = 222; # port = 222;
identityFile = config.age.secrets.youwen_dev_ssh_priv_key.path; identityFile = config.age.secrets.youwen_dev_ssh_priv_key.path;
identitiesOnly = true;
}; };
"github" = { "github" = {
host = "github.com"; host = "github.com";
identityFile = config.age.secrets.github_ssh_priv_key.path; identityFile = config.age.secrets.github_ssh_priv_key.path;
identitiesOnly = true;
}; };
"gallium" = { "gallium" = {
host = "gallium"; host = "gallium";
port = 222; port = 222;
identityFile = config.age.secrets.gallium_server_ssh.path; identityFile = config.age.secrets.gallium_server_ssh.path;
identitiesOnly = true;
}; };
"truth.youwen.dev" = { "truth.youwen.dev" = {
host = "truth.youwen.dev"; host = "truth.youwen.dev";
port = 222; port = 222;
identitiesOnly = true;
identityFile = config.age.secrets.gallium_server_ssh.path; identityFile = config.age.secrets.gallium_server_ssh.path;
}; };
}; };