This instruction explains the steps to secure copy data to an other Synology NASĀ via the scp protocol. The scp commando’s are executed in a terminal session that’s why SSH must be enabled on both Synology NAS servers. Be careful running the terminal commands because files and folders can be deleted, running the commands are at your own risk
Turn on ssh on Synology NAS
Warning:
Enabling SSH service may bring security risks to your system. Please enable it only when necessary and avoid making changes to system configurations.
Enable SSH service:
- Login to your NAS via a webbrowser. see instruction how
Control Panel, Connectivity
Terminal & SNMP
Terminal
Tick Enable SSH service.
Scenario:
Name Source Synology NAS server: server01
Name Destination Synology NAS server: server02
Shared folder on server01: test test
Shared folder on server02: test test
volume: volume1Ā
Purpose: make source shared folder the same on the destination NAS.
Access DSM via SSH
Login as a admin user but don’t change to root user.
Launch the terminal application on your computer.
Type the following command and press Enter:
ssh <DSM_admin_account>@<DSM IP address>or<DNS_Name> -p SSH_ port_number
Enter the password of your DSM administrator account
Example:
ssh myadmin@10.17.2.6 -p 22
Identify both folders for the secure copy
Choose which folder on the source Synology NAS you want to secure copy to the other Synology NAS server which will be the destination.Ā
run scp from server01:
Run the following Synology scpĀ terminal commands at your own risk!
cd /volume1
pwd
check directory location: /volume1Ā
scp -rpĀ Ā test\ testĀ <admin user>@server02:/volume1/
Meaning switches scp command
-r Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal
-p Preserves modification times, access times, and modes from the original file.
Ā
Hidden files
Running the scp command: scp -rp test\ test without “\” at the end of the second “test” will also copy the hidden files.Ā
@eaDir
Having the “@eaDir” subfolder in the subfolder you want to copy results in failure to copy. I have removed this folder first and after the copy works fine.Ā
Doing so according to Synology Support:
“They are system folders, they’re are meant to be used by our differents softwares for them to work.
It is by design, used for software+system
you may not touch them otherwise you may make things to stop functionning correctly.”
Ā