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
|
# hardened openssh
|
||||||
services.openssh = {
|
services = {
|
||||||
allowSFTP = false;
|
fail2ban.enable = true;
|
||||||
extraConfig = ''
|
endlessh = {
|
||||||
AllowTcpForwarding yes
|
enable = true;
|
||||||
X11Forwarding no
|
port = 22;
|
||||||
AllowAgentForwarding no
|
openFirewall = true;
|
||||||
AllowStreamLocalForwarding no
|
};
|
||||||
AuthenticationMethods publickey
|
openssh = {
|
||||||
'';
|
enable = true;
|
||||||
|
ports = [ 5011 ];
|
||||||
settings = {
|
settings = {
|
||||||
KbdInteractiveAuthentication = false;
|
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
|
KbdInteractiveAuthentication = false;
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
AllowUsers = [ "srv" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue