initial commit
This commit is contained in:
commit
40b596d46d
3 changed files with 108 additions and 0 deletions
76
configuration.nix
Normal file
76
configuration.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ inputs, lib, pkgs, ... }:
|
||||
{
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
git
|
||||
];
|
||||
|
||||
users.users.reudy = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ]; #sudo
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC6TOSFZ+P0oWTa9U3fX/L9c3btv/lCgzPrwKu621aLDjSbWbaddGhAXQtJvl7GJvs7QN52z+icftK94gdeyTbZyzQtY6JNUVmUs5EHlZlYTkAYSFN/rkn6N7/n9aYRN+vd8r0B4IrP5gTPtGglLD16dfukpOgwtQj/eK6tqZpVlZ7LnKK7UaA6a4OXMYgJZAwdzAOfFGfbO++5q+igBdfNJmh5LtYMI6te8AlJGBSVierzeStEzTVbIys1EsyNrEMzAljHBxxco2L7enNmz4xciRNCQ/za5xPmhf8nOoZTIalBziM52DGH6rFzUEBVsqez1U2U4ajVzdSIudOlku4w63YnClHeGNu9AdHJjR7PbIHwui17aGKM/l/Qv/LOWWo+nfO1hbCl0fGZwVkl8p4yR3WM73OWEHn1f+Uc4cWAUDZ/ZDPE0qyA/HAnSA6dfzY66y2evjRBeekA4zcxgmc7Q/2XfKHDYMEKTNkgdO6UAFoUqW4BiyF36FcS1ccjUok= root@DESKTOP-40EVMS3"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahgKnADam4PGc9TiANkWGx09uNuS42tllj70UuyzPf u0_a279@localhost"
|
||||
];
|
||||
};
|
||||
security.sudo.wheelNeedsPassword = true;
|
||||
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
|
||||
# Allow root login with password, needed for passwords set through vpsAdmin
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
X11Forwarding = false;
|
||||
AllowUsers = [ "reudy" ];
|
||||
};
|
||||
|
||||
ports = [ 14902 ];
|
||||
|
||||
# Needed for public keys deployed through vpsAdmin, can be disabled if you
|
||||
# authorize your keys in configuration
|
||||
authorizedKeysInHomedir = true;
|
||||
};
|
||||
|
||||
# fail2ban
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
bantime = "24h";
|
||||
bantime-increment = {
|
||||
enable = true;
|
||||
multipliers = "1 2 4 8 16 32 64";
|
||||
maxtime = "168h";
|
||||
overalljails = true;
|
||||
};
|
||||
jails.sshd.settings = {
|
||||
enabled = true;
|
||||
port = "14902";
|
||||
maxretry = 3;
|
||||
findtime = "10m";
|
||||
bantime = "1h";
|
||||
};
|
||||
};
|
||||
|
||||
# Networking
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 80 443 14902 ]; # http https ssh
|
||||
};
|
||||
|
||||
systemd.settings.Manager = {
|
||||
DefaultTimeoutStartSec = "900s";
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue