add sshd for aws generators

This commit is contained in:
Noah Masur
2022-09-20 11:50:45 +00:00
parent 50a538c78e
commit 9e3345ff9b
2 changed files with 27 additions and 0 deletions

24
modules/services/sshd.nix Normal file
View File

@ -0,0 +1,24 @@
{ config, pkgs, lib, ... }: {
options = {
publicKey = lib.mkOption {
type = lib.types.str;
description = "Public SSH key authorized for this system.";
};
};
config = {
services.openssh = {
enable = true;
ports = [ 22 ];
passwordAuthentication = false;
gatewayPorts = "no";
forwardX11 = false;
allowSFTP = true;
permitRootLogin = "no";
};
users.users.${config.user}.authorizedKeys.keys = [ config.publicKey ];
};
}