Our thinking


Change ownership of Synology Cloud Sync tasks

Synology have advised people for some time now to not use an administrator user called admin, as this account will be subject to password guessing attacks. While all my clients have strong passwords on their admin users, having a different username for the main administrative account is an extra layer of security that it makes sense to employ.

When setting up a new NAS, Synology DSM will not let you chose the username admin, nor will it let you use administrator. This is great for a new NAS, however for existing devices out there, it can be difficult to disable the existing admin user as there are generally a number of tasks tied to this account.

Cloud Sync is one such system where the username is tied directly to the sync tasks, and if you disable the account that set up the respective sync task, then the task is disabled.

If you have a lot of Cloud Sync tasks it can be complicated to re-do them all, particularly if this means you need to resync hundreds of thousands of files with your cloud backup service, like Backblaze B2.

Fortunately there is a way to change the ownership of these tasks – it may not be endorsed by Synology, and it may break your server in unusual and exciting ways, but it worked for me, so here it is from the Synology Community

CloudSync migration after reinstall: DSM account of the owner for this synchronization task has been deleted

I’m adding the solution here in case the original disappears at some stage in the future.

The settings are stored in an SQLite database and can be modified there. I took the following steps.

  • Stop the cloud sync service from the Package Manager
  • Connect to the Synology NAS via ssh
  • Navigate to the volume where the configuration for CloudSync resides, and then into the config folder. e.g. cd /volume1/@cloudsync/db
  • Look up the user id and group id of our new admin user. Run id -u new_admin_username and id -g new_admin_username. Lets assume these admin uid is 1033 and gid is 100
  • Run an sqlite shell for the config database by typing sudo sqlite3 config.sqlite
  • Check the existing connections by typing select * from connection_table; (and don’t forget the semicolon at the end like I always do)
  • Note down the ids of the configuration lines that need a change. This is the first number in each row.
  • Update the uid, gid and username in each affected row via update connection_table set uid=1033, gid=100, local_user_name="new_admin_username" where id=3; the id at the end of the command will indicate which row you want to update.
  • Repeat this for each row you need to update.
  • Review the connections by typing select * from connection_table; (again don’t forget the semicolon at the end)
  • Type .quit to exit the sqlite shell.
  • Go to the Package Manager and start the Cloud Sync package.

2 thoughts on “Change ownership of Synology Cloud Sync tasks

  1. A couple of notes. If you make a mistake whilst in sqlite3, hit “ctrl D” to exit back to the SSH session. Also, if the full command “update connection_table set uid=1033, gid=100, local_user_name=”new_admin_username” where id=3;” doesn’t work, a truncated version may.
    e.g. update connection_table set uid=1042, gid=100 where id=1;

Leave a Reply