summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configuration.nix15
-rw-r--r--justfile3
-rw-r--r--ssh.nix16
3 files changed, 19 insertions, 15 deletions
diff --git a/configuration.nix b/configuration.nix
index dfdbb64..137e2f4 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -4,26 +4,13 @@
./minecraft.nix
./options.nix
./git.nix
+ ./ssh.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
- services.fail2ban.enable = true;
-
- services.openssh = {
- enable = true;
- authorizedKeysInHomedir = false; # trust only /etc/ssh/authorized_keys.d/%u
- settings = {
- PasswordAuthentication = false;
- PermitRootLogin = "no";
- AllowUsers = [ "kassouni" "git" ];
- KbdInteractiveAuthentication = false;
- PubkeyAuthentication = true;
- };
- };
-
users.users.kassouni = {
extraGroups = [ "wheel" ];
isNormalUser = true;
diff --git a/justfile b/justfile
index 96c2c25..339a1c6 100644
--- a/justfile
+++ b/justfile
@@ -1,8 +1,9 @@
host := "kassouni@5.78.230.100"
+port := "26802"
config := "kassouni-net"
deploy:
nixos-rebuild switch --flake .#{{config}} --target-host {{host}} --build-host {{host}} --sudo --ask-sudo-password
ssh:
- ssh {{host}}
+ ssh -p {{port}} {{host}}
diff --git a/ssh.nix b/ssh.nix
new file mode 100644
index 0000000..9d0c84a
--- /dev/null
+++ b/ssh.nix
@@ -0,0 +1,16 @@
+{...}:{
+ services.fail2ban.enable = true;
+
+ services.openssh = {
+ enable = true;
+ ports = [26802];
+ authorizedKeysInHomedir = false;
+ settings = {
+ PasswordAuthentication = false;
+ PermitRootLogin = "no";
+ AllowUsers = [ "kassouni" "git" ];
+ KbdInteractiveAuthentication = false;
+ PubkeyAuthentication = true;
+ };
+ };
+}