add options to allow backing up to specific machine
This commit is contained in:
32
backup-target.nix
Normal file
32
backup-target.nix
Normal 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 ];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user