diff --git a/management/backup.py b/management/backup.py index 32d77d1a..e8aca327 100755 --- a/management/backup.py +++ b/management/backup.py @@ -477,6 +477,10 @@ def get_backup_config(env, for_save=False, for_ui=False): if config["target"] == "local": # Expand to the full URL. config["target"] = "file://" + config["file_target_directory"] + elif config["target"].startswith('rsync'): + ssh_pub_key = os.path.join('/root', '.ssh', 'id_rsa.pub') + if os.path.exists(ssh_pub_key): + config["ssh_pub_key"] = open(ssh_pub_key, 'r').read() return config diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html index 04c2c8e0..1511125c 100644 --- a/management/templates/system-backup.html +++ b/management/templates/system-backup.html @@ -37,9 +37,6 @@ they are safe to store anywhere.

Separately copy the encryption password from to a safe and secure location. You will need this file to decrypt backup files.

-

Separately copy the SSH public key from /root/.ssh/id_rsa.pub - and add it to your backup account on your remote server, in the - ~/.ssh/authorized_keys file.

@@ -61,6 +58,17 @@ +
+ +
+ +
+ Copy the Public SSH Key above, and paste it within the ~/.ssh/authorized_keys + of target user on the backup server specified above. That way you'll enable secure and + passwordless authentication from your mail-in-a-box server and your backup server. +
+
+
@@ -208,6 +216,7 @@ function show_custom_backup() { $("#min-age").val(r.min_age_in_days); $(".backup-location").text(r.file_target_directory); $(".backup-encpassword-file").text(r.enc_pw_file); + $("#ssh-pub-key").val(r.ssh_pub_key); if (r.target == "file://" + r.file_target_directory) { $("#backup-target-type").val("local");