Backup to the Synology Server using DeltaCopy with SSH
From SynologyWiki
Introduction
| This guide will cover how to use DeltaCopy, a Windows rsync Client, with SSH Encryption to backup user data to the Synology product. This guide will also instruct in the creation of automated schedules.
The purpose of using DeltaCopy is to allow remote users to backup to their Synology system, such as when users are traveling on business trips, or stationed at remote offices. |
This guide assumes the following
- That Network Backup Services is Enabled on the Synology product
- That Telnet or SSH Services is enabled on the Synology product
- That you are familiar with the Synology Web Management Menu, and that you know how to manipulate permissions on the server
- That you are familiar with performing file management functions, such as copying files from one location to another
- That for the remote server, ports are forwarded as necessary
- Data Port: 873
- Encrypted Data Communications: 22
- That you are familiar with manipulating Anti-Malware software to grant access to these Internet programs. Some Anti-Malware programs for example are:
- Norton/Mcafee/AVG Anti-Virus Applications
- Norton/Mcafee/AVG Internet Security Applications
- Windows Firewall
- Windows User Account Control
- Windows Defender
- ZoneAlarm
- etc.
- While not required: an understanding of Windows/Linux/Unix commands is recommended
Note: if SSH is not required, please refer to the steps that are colored purple
Software Requirements
The Synology server must be at firmware 2.0.3-0518 or above
DeltaCopy
cygwin
UNICODE enabled cygwin DLL (for those of us that need to backup files w. special characters ie. with umlauts and such.)
Install DeltaCopy
Install Cygwin
Step 11:
To enable support for unicode characters download the unicode Cygwin dll and copy it to the DeltaCopy directory replacing the non unicode one.
Creating a SSH-Key
This section can be skipped if SSH is not required
Step 1:Execute Cygwin, from your Desktop | |
Step 2:Type into the BASH command prompt
| |
Step 3:DO NOT type in anything else. Just press the "ENTER" key until the application is finished and a key was generated and saved. Refer to the image for an example
|
File Manipulation Tasks
Steps 1, 2, 3 may be skipped if SSH is not required
Step 1:
Go to the following folder C:\Program Files\cygwin\home\UserProfileName\.ssh
- Note: UserProfileName is the name of your Windows User Profile, it is a variable and will be different for each user
Step 2:
Move id_rsa.pub to \\DiskStation\NetBackup\
- Note: DiskStation is the name of the Synology product, please adjust accordingly
The final location should be
\\DiskStation\NetBackup\id_rsa.pub
Step 3:
Move id_rsa. to C:\Program Files\DeltaCopy\
The final location should be
C:\Program Files\DeltaCopy\id_rsa
Step 4:
Go to C:\Program Files\cygwin\bin
Copy the following files to C:\Program Files\DeltaCopy
Overwrite older versions if necessary
cygcrypto-0.9.8.dll cygminires.dll cygpopt-0.dll cygz.dll ssh.exe
The final location should be
C:\Program Files\DeltaCopy\cygcrypto-0.9.8.dll C:\Program Files\DeltaCopy\cygminires.dll C:\Program Files\DeltaCopy\cygpopt-0.dll C:\Program Files\DeltaCopy\cygz.dll C:\Program Files\DeltaCopy\ssh.exe
Creating Authorized Keys on the Synology Server
This section can be skipped if SSH is not required
Step 1:
Telnet or SSH into the Synology Product as root and perform the following
> cd /root > mkdir .ssh > mv /volume1/netbackup/id_rsa.pub /root/.ssh/authorized_keys > chmod 700 /root/.ssh > chmod 600 /root/.ssh/authorized_keys > chown -R root /root/.ssh > chown -R root /root/.ssh/authorized_keys
Step 2:Attached is the image of the final result |
Authentication of Keys between the client computer and the Synology Server
This section can be skipped if SSH is not required
Step 1:
Go to [Start] --> [Run] --> Type cmd
Then type the following
> cd \Program Files\Deltacopy > ssh -i id_rsa root@192.168.0.12
Where id_rsa is the path of your private key
Where 192.168.0.12 is the IP address of the Synology product
Step 2:Type yes to add the server to the list of known hosts
|
Configuring DeltaCopy
Step 1:Launch DeltaCopy Client | ||||||||
Step 2:Double Click on Add New Profile and enter in the following information
Then click Add Profile | ||||||||
Step 3:Click on the Authentication Tab
| ||||||||
Step 4:Skip this step if SSH is not being used
| ||||||||
Step 5:Click on File List and then proceed to click Add Folder
| ||||||||
| ||||||||
Step 6:Right-Click on your profile name, and proceed with Run Now | ||||||||
Step 7:The system will then perform a backup with the following window displayed. Attached is a sample log file
Executing: rsync.exe -v -rlt -z --delete -e "ssh -l root -i id_rsa" "/cygdrive/D/test Data/" __ "root@192.168.0.12:/var/services/NetBackup/test\ Data/" building file list ... done created directory /var/services/NetBackup/test Data ./ 2007.02.02.Lake Wenatchee/ 2007.02.02.Lake Wenatchee/img_0324.JPG ....FILES THAT WERE COPIED.... sent 55675368 bytes received 754 bytes 1661973.79 bytes/sec total size is 56813443 speedup is 1.02 Profile 'taurus' executed in 32718 milliseconds. It ran successfully. | ||||||||
Step 8:Here is the view of the data that was backed up | ||||||||
Step 9:To create a schedule, perform the following.
|
Notes
Multiple Computers
This note may be ignored for non-SSH users
A key will have to be made for each user. For the authorized_keys file, append the file so it has keys from each of the public keys, do not create multiple files in /root/.ssh/. A recommended program to use to append the authorized_keys is Notepad++; be sure to disable word wrapping when editing the file. One key per line please!
An example of the final outlook of /root/.ssh/authorized_keys is provided below
ssh-rsa ***Key here***== user1@machine1 ssh-rsa ***Key here***== user2@machine2
Known Limits
DeltaCopy, as it depends on Cygwin, does not support unicode characters without the special unicode cygwin.dll, or paths larger than 255 characters
