started SSH certs
This commit is contained in:
@@ -3,17 +3,26 @@ let
|
||||
userName = "john";
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.ssh = {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
# require public key authentication for better security
|
||||
settings.PasswordAuthentication = false;
|
||||
settings.KbdInteractiveAuthentication = false;
|
||||
flake.modules.nixos.ssh = { pkgs, config, lib, ... }: {
|
||||
options = {
|
||||
ssh.certificates = lib.mkEnableOption "Enable SSH certificates";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = with inputs.self.modules.homeManager; [
|
||||
ssh
|
||||
];
|
||||
config = {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
# require public key authentication for better security
|
||||
settings.PasswordAuthentication = false;
|
||||
settings.KbdInteractiveAuthentication = false;
|
||||
};
|
||||
|
||||
programs.ssh.knownHosts = lib.mkIf config.ssh.certificates {
|
||||
"192.168.1.*" = {
|
||||
certAuthority = true;
|
||||
publicKey = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNug18oLH0vZxnibXJzMJvTWFPZTnSlhCDDVi+rHhgnIum6ZXQ4SF+VHOOAM5BbzZmMKitNJ5lcrGP15Eur7DzQ=";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.ssh = { pkgs, config, lib, ... }:
|
||||
|
||||
Reference in New Issue
Block a user