feat(openssh): reconfigure hardening based on nixos wiki reccomendations
This commit is contained in:
parent
c6135ee301
commit
383989516c
1 changed files with 16 additions and 12 deletions
|
|
@ -42,18 +42,22 @@
|
|||
};
|
||||
|
||||
# hardened openssh
|
||||
services.openssh = {
|
||||
allowSFTP = false;
|
||||
extraConfig = ''
|
||||
AllowTcpForwarding yes
|
||||
X11Forwarding no
|
||||
AllowAgentForwarding no
|
||||
AllowStreamLocalForwarding no
|
||||
AuthenticationMethods publickey
|
||||
'';
|
||||
services = {
|
||||
fail2ban.enable = true;
|
||||
endlessh = {
|
||||
enable = true;
|
||||
port = 22;
|
||||
openFirewall = true;
|
||||
};
|
||||
openssh = {
|
||||
enable = true;
|
||||
ports = [ 5011 ];
|
||||
settings = {
|
||||
KbdInteractiveAuthentication = false;
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
AllowUsers = [ "srv" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue