forked from nico/dots
chore: organise modules
Organise modules in a significantly better way with categories.
This commit is contained in:
parent
7444260d7d
commit
3660ef23f1
33 changed files with 77 additions and 76 deletions
27
modules/services/ssh.nix
Normal file
27
modules/services/ssh.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
allowSFTP = true;
|
||||
openFirewall = false;
|
||||
authorizedKeysInHomedir = false;
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
GatewayPorts = "no";
|
||||
};
|
||||
};
|
||||
|
||||
# add ssh key
|
||||
users.users.nico.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHzUJnqCpbRxggjyIZo4KWnTyHobPdi/xXkN1/n/yIMD"
|
||||
];
|
||||
|
||||
# enable ssh in the firewall
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
||||
# enable fail2ban
|
||||
services.fail2ban.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue