Compare commits
2 Commits
ec3d9e6049
...
0cf53a97cf
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0cf53a97cf | ||
![]() |
46fe5b8056 |
@ -9,19 +9,24 @@ in
|
|||||||
enable = mkEnableOption "ssh";
|
enable = mkEnableOption "ssh";
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.openssh.enable = true;
|
services.openssh = {
|
||||||
# TODO: Is this default configuration secure?
|
enable = true;
|
||||||
|
settings = {
|
||||||
services.openssh.hostKeys = mkIf (config.modules.impermanence.enable) [
|
PasswordAuthentication = false;
|
||||||
{
|
KbdInteractiveAuthentication = false;
|
||||||
type = "ed25519";
|
PermitRootLogin = "no";
|
||||||
path = "/persist/system/etc/ssh/ssh_host_ed25519_key";
|
};
|
||||||
}
|
hostKeys = mkIf (config.modules.impermanence.enable) [
|
||||||
{
|
{
|
||||||
type = "rsa";
|
type = "ed25519";
|
||||||
bits = 4096;
|
path = "/persist/system/etc/ssh/ssh_host_ed25519_key";
|
||||||
path = "/persist/system/etc/ssh/ssh_host_rsa_key";
|
}
|
||||||
}
|
{
|
||||||
];
|
type = "rsa";
|
||||||
|
bits = 4096;
|
||||||
|
path = "/persist/system/etc/ssh/ssh_host_rsa_key";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Local user
|
# Local user
|
||||||
sops.secrets."ssh-keys/admin-pub" = { };
|
modules.secrets.secrets."ssh-keys/admin-pub" = { };
|
||||||
|
modules.secrets.secrets."passwords/local-hashed".neededForUsers = true;
|
||||||
services.getty.autologinUser = "local";
|
services.getty.autologinUser = "local";
|
||||||
security.sudo.extraRules = [
|
security.sudo.extraRules = [
|
||||||
{
|
{
|
||||||
@ -43,6 +44,7 @@ in
|
|||||||
];
|
];
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
users.users.local = {
|
users.users.local = {
|
||||||
|
hashedPasswordFile = config.sops.secrets."passwords/local-hashed".path;
|
||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
openssh.authorizedKeys.keyFiles = [
|
openssh.authorizedKeys.keyFiles = [
|
||||||
config.sops.secrets."ssh-keys/admin-pub".path
|
config.sops.secrets."ssh-keys/admin-pub".path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user