add options to allow backing up to specific machine

This commit is contained in:
2024-12-12 22:24:11 +01:00
parent f4f9112c05
commit 2668121c52
2 changed files with 34 additions and 0 deletions

32
backup-target.nix Normal file
View File

@@ -0,0 +1,32 @@
# configuration allowing this machine to be user as a backup server
{ config, lib, pkgs, ... }:
{
users.users.backup = {
isNormalUser = true;
openssh.authorizedKeys.keys = [
''command="${pkgs.rrsync}/bin/rrsync /mnt/backup",restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF1e7hxxQD7pVKMquEuiBrLNFfx9ZRAOU1SGky4iXacD''
#''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF1e7hxxQD7pVKMquEuiBrLNFfx9ZRAOU1SGky4iXacD Ithuriel@openmediavault''
];
packages = [
pkgs.rsync
pkgs.rrsync
];
};
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = true;
KbdInteractiveAuthentication = false;
# AllowUsers = [ "backup" ];
# UseDns = true;
X11Forwarding = false;
PermitRootLogin = "no";
};
};
networking.firewall.allowedTCPPorts = [ 22 ];
}