Skip to content

Instantly share code, notes, and snippets.

@jamesog
Created March 3, 2023 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesog/d968f730990bd4772b13ce8ee9167e79 to your computer and use it in GitHub Desktop.
Save jamesog/d968f730990bd4772b13ce8ee9167e79 to your computer and use it in GitHub Desktop.
NixOS using SSH CA
{ 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 ..."
];
}
@jamesog
Copy link
Author

jamesog commented Mar 3, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment