##Enable user home service
Open the Control panel, in the User section go to Advanced tab and in the section User Home:
-
Enable user home serviceClickApply
##Enable SSH
Go to Terminal & SNMP section and:
-
Enable SSH serviceAnd choose thePORTthat you want to use.
[Optional] You can change the default security level in
Advanced settingstohigh.
Click Apply
##Activate RSync
Go to File Services in rsync tab.
-
Enable rsync serviceYou could use the samePORTasSSHor choose a new one only forrsync.
##Create SSH key You need to create private/public keys on your local computer if you don't already have some:
ssh-keygen -t rsaValidate by pressing ENTER with an empty passphrase.
Then change the right access:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*And send the public key to your NAS:
ssh-copy-id -i ~/.ssh/id_rsa.pub -p SSH_PORT ADMIN_USER_ONLY@XXX.XXX.XXX.XXX##Enable the SSH key
Connect to you NAS with ssh with your password:
ssh -p SSH_PORT ADMIN_USER_ONLY@XXX.XXX.XXX.XXXAnd change the right access on the key and the user folder:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
chmod u=rwx,g=rx,o=rx /volume1/homes/ADMIN_USER_NAME/Then you should be able to connect with ssh only with your SSH-key (without password):
ssh -p SSH_PORT ADMIN_USER_ONLY@XXX.XXX.XXX.XXX##Check the rsync connection
Now you should be able to connect also with rsync:
rsync -av -e 'ssh -p PORT_RSYNC' ORIGIN/FOLDER/TO/SYNC/ USER@XXX.XXX.XXX.XXX:/volume1/homes/USERNAME/DESTINATION/FOLDER/Then, if you want you can disable the SSH access without loosing rsync:
-
Enable SSH service
You can even remove the user from the admin group.
##Source: NAS-Forum (FR)
Works like a charm, thank you!
DSM: 6.2.2-24922 Update 4
Client: Ubuntu 18.04.4 LTS "bionic"