Add sshd config to disallow root/passwordless login, change default port
This commit is contained in:
parent
a5acf870fe
commit
0e5c375312
|
@ -9,6 +9,7 @@
|
||||||
./desktop/hyprland.nix
|
./desktop/hyprland.nix
|
||||||
./desktop/steam.nix
|
./desktop/steam.nix
|
||||||
./syncthing/Vanguard.nix
|
./syncthing/Vanguard.nix
|
||||||
|
./server/sshd.nix
|
||||||
./server/adguardhome.nix
|
./server/adguardhome.nix
|
||||||
./server/gitea.nix
|
./server/gitea.nix
|
||||||
];
|
];
|
||||||
|
@ -16,15 +17,8 @@
|
||||||
networking.hostName = "Vanguard"; # Define your hostname.
|
networking.hostName = "Vanguard"; # Define your hostname.
|
||||||
#networking.wireless.networks."LAN LAN Ranch".pskRaw = "d4c31e976456783b61d573ee49c94f93914a81bf1048c2f2e1e166c36bdfcd4a";
|
#networking.wireless.networks."LAN LAN Ranch".pskRaw = "d4c31e976456783b61d573ee49c94f93914a81bf1048c2f2e1e166c36bdfcd4a";
|
||||||
networking.nameservers = [ "192.168.1.166" "9.9.9.9" ];
|
networking.nameservers = [ "192.168.1.166" "9.9.9.9" ];
|
||||||
services.openssh.enable = true;
|
|
||||||
networking.firewall = { enable = true; allowedTCPPorts = [ 22 ]; };
|
networking.firewall = { enable = true; allowedTCPPorts = [ 22 ]; };
|
||||||
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII1tJFdbiyJApuVZFvo9E9kjlBwvXZeySqVuS2qGdxha tux@monarch"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINI1dWlS16Keil0MGPWmMsBzx8F9ylfz+fRwxUr8/tZ/ ion"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAcvAQ8W71Bn8pdMYst1hoVCmVJ+0h4HBlJzu1C6dwy xenia@Northstar"
|
|
||||||
];
|
|
||||||
|
|
||||||
users.users.xenia = {
|
users.users.xenia = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Evie Litherland-Smith";
|
description = "Evie Litherland-Smith";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
imports = [ ./traefik.nix ./fail2ban.nix ];
|
imports = [ ./traefik.nix ./fail2ban.nix ];
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.server = { DOMAIN = "git.xenia.me.uk"; SSH_PORT = 2222; };
|
settings.server = { DOMAIN = "git.xenia.me.uk"; }; # SSH_PORT = 2222; };
|
||||||
appName = "Gitea";
|
appName = "Gitea";
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 2222 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 2222 ];
|
||||||
|
|
14
server/sshd.nix
Normal file
14
server/sshd.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
ports = [ 2222 ];
|
||||||
|
settings = {
|
||||||
|
UseDns = true;
|
||||||
|
PermisRootLogin = "no";
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
GatewayPorts = "yes";
|
||||||
|
LogLevel = "VERBOSE";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue