Created
March 3, 2023 12:09
-
-
Save jamesog/d968f730990bd4772b13ce8ee9167e79 to your computer and use it in GitHub Desktop.
NixOS using SSH CA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
environment.etc = { | |
"ssh/ca.pub".text = '' | |
ssh-rsa ... | |
''; | |
}; | |
services.openssh.extraConfig = | |
'' | |
TrustedUserCAKeys /etc/ssh/ca.pub | |
''; | |
# Note that nixos-rebuild will complain if no users have a password nor authorizedKeys set, so add a backup key | |
users.users.jamesog.openssh.authorizedKeys.keys = [ | |
"ecdsa-sha2-nistp256 ..." | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is now a blog post: https://jamesog.net/2023/03/03/setting-up-nixos-to-use-an-ssh-ca/