8/19/2023 0 Comments Synology hidriveIn my initial tries I did have to give its password quite a few times until I noticed that my authorised_keys file was under rsync’s home directory & not under the rsync/.ssh directory! Silly me!! □ Hence I will now be able to automate it using the cron utility. I could just now run the rysnc command too w/o providing rsync user’s password. If you would like to have it run automatically, you can setup a cronjob on your external server, for example:Ġ 0 * * * rsync -av –delete -e “ssh -i /home//.ssh/id_rsa -p ” love to get your feedback if this did or didn’t work for you! If you do not wish for the rsync to delete backed up files on the Synology NAS, when they are deleted on the external server, just remove –delete from the command Replace with the address to your Synology NAS Replace with the directory that you would like to back up Replace with the port that you went with for rsync on your Synology NAS Rsync -av -delete -e "ssh -i /home//.ssh/id_rsa -p " with the user of your external server When this has been done, we are ready to try and perform an rsync from the external server: The content of the id_rsa.pub file has to be copied to your authorized_keys file on the Synology NAS, to allow the external server to rsync its content. ssh folder, which you can access by entering: They are put into your currently logged on users. The key is named id_rsa and the keyhole is named id_rsa.pub. Do not set a passphrase, as the passphrase will then be needed in the rsync command. SSH to the external server with an appropriate user that has access to the content that you would like to back up and use the following command:įollow the instructions to have what I like to call a key and keyhole generated. Let’s get started on the external server! To exit and save the file enter: :wq and press Enter Go to the home directory of the rsync user that we created earlier:Ĭreate a folder that will be used to store SSH key generated information:Ĭreate an empty file called authorized_keys: While using this account, please be careful with what you type: Type the below command to start working as root. If it isn’t already active go to: Control Panel -> Terminal & SNMP -> Enable SSH service (As with rsync, I would recommend using another port than the default 22)Ĭonnect to your Synology NAS using your favorite SSH client (I prefer PuTTY myself) and the administrator credentials. Now, enable SSH access to your Synology NAS. This is going to be important because of what we’re going to do next. Then Scroll to the bottom and put a check mark in Enable user home service. If you have not set up home folders for your Synology users, we will have to enable it by going to The Control Panel -> User -> Advanced. User Speed Limit Settings shouldn’t matter either and you can press Next and lastly Apply to create the user.When assigning application permissions, find rsync (Shared Folder Sync, LUN Backup on supported models), allow it and press Next. ![]() If that doesn’t matter to you, press Next User quota settings only matters, if you would make sure that it can only take up a certain amount of space.Now find the newly created share (NetBackup) on the list and give the user Read/Write access to it and press Next.The user does not need to be part of any special group, so just put it in regular users group and press Next.Call the user rsync (or whatever you would prefer to call the user) and press Next.Go to User and press the Create button to create a new user.Once again go to the Web interface and continue to the Control Panel. ![]() Second step will be to create a new user on your Synology NAS to use specifically for rsync: A new Share will be created automatically called NetBackup (This is where your backups will be stored).Put a check mark in Enable rsync service (I would highly recommend generating a random port number for rsync activity to increase security).Go to File Services and choose the rsync tab at the top.Go to the Web interface and continue to the Control Panel.You will also need to know how to setup port forwarding to allow access to your NAS.įirst step will be to enable rsync on your Synology NAS: If that makes you uncomfortable, this guide is not going to be for you. ![]() This will require you to fiddle with your Synology NAS via SSH. In this article I will be explaining step by step, how you can perform a backup task using rsync from your external Linux server (Debian Stretch in this case) to your Synology NAS automatically and on a schedule. This might come in handy, if your server hosting provider takes extra for backup, then why not just backup to your own home and save yourself a couple of bucks! If you, like me, have a Synology NAS at home, you might want to offload some files from your other servers as a backup.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |