allow sftp
This commit is contained in:
parent
73e31ca37c
commit
c181069544
3 changed files with 11 additions and 3 deletions
|
|
@ -51,11 +51,19 @@ in
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.openssh.sftpServerExecutable = "internal-sftp";
|
||||||
|
services.openssh.extraConfig = ''
|
||||||
|
Match User picardbackup
|
||||||
|
ChrootDirectory ${config.users.users.picardbackup.home}
|
||||||
|
ForceCommand internal-sftp
|
||||||
|
AllowTcpForwarding no
|
||||||
|
'';
|
||||||
|
|
||||||
# Backup Target
|
# Backup Target
|
||||||
users.users.picardbackup = {
|
users.users.picardbackup = {
|
||||||
createHome = true;
|
createHome = true;
|
||||||
group = "users";
|
group = "users";
|
||||||
home = "/backups/picard";
|
home = "/backups/restic/picard";
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHvCF8KGgpF9O8Q7k+JXqZ5eMeEeTaMhCIk/2ZFOzXL0"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHvCF8KGgpF9O8Q7k+JXqZ5eMeEeTaMhCIk/2ZFOzXL0"
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
"--keep-yearly 75"
|
"--keep-yearly 75"
|
||||||
];
|
];
|
||||||
initialize = true;
|
initialize = true;
|
||||||
repository = "sftp:ds9:/backups/picard/restic";
|
repository = "sftp:picardbackup@ds9:/restic";
|
||||||
paths = [
|
paths = [
|
||||||
"/persistent"
|
"/persistent"
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ in
|
||||||
security.sudo.execWheelOnly = true;
|
security.sudo.execWheelOnly = true;
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
passwordAuthentication = false;
|
passwordAuthentication = false;
|
||||||
allowSFTP = false; # just use rsync, lol
|
allowSFTP = true; # just use rsync, lol
|
||||||
kbdInteractiveAuthentication = false;
|
kbdInteractiveAuthentication = false;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
AllowTcpForwarding yes
|
AllowTcpForwarding yes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue