mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 22:00:14 +00:00
add sshd for aws generators
This commit is contained in:
24
modules/services/sshd.nix
Normal file
24
modules/services/sshd.nix
Normal 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 ];
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user