Skip to content

Instantly share code, notes, and snippets.

@seignovert
Last active September 7, 2023 02:01
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save seignovert/c903c2facbf88243dac90de68be696ea to your computer and use it in GitHub Desktop.
Save seignovert/c903c2facbf88243dac90de68be696ea to your computer and use it in GitHub Desktop.
Enable RSync with Synology DSM 6.0 without RSA SSH-key

Enable RSync with Synology DSM 6.0 without RSA SSH-key

##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 service Click Apply

##Enable SSH Go to Terminal & SNMP section and:

  • Enable SSH service And choose the PORT that you want to use.

[Optional] You can change the default security level in Advanced settings to high.

Click Apply

##Activate RSync Go to File Services in rsync tab.

  • Enable rsync service You could use the same PORT as SSH or choose a new one only for rsync.

##Create SSH key You need to create private/public keys on your local computer if you don't already have some:

ssh-keygen -t rsa

Validate 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.XXX

And 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)

@flandersen
Copy link

flandersen commented Mar 29, 2020

Works like a charm, thank you!
DSM: 6.2.2-24922 Update 4
Client: Ubuntu 18.04.4 LTS "bionic"

@clistion
Copy link

clistion commented Sep 7, 2023

after I solve the problem, I find this tuto :p
DSM: 7
Client: Ubuntu 22.04 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment