Categories: How To'sSynology

Block Users from accessing Synology DSM Desktop (and fix if you’re stuck out)

One particularly nice feature of DSM 6.1.x is that it now allows you to block access to the Desktop backend for any user or user group.


Warning:

Do not apply these settings without first explicitly allowing access for the admin user(s). Otherwise you will be locked out of accessing DSM yourself. If you ended up in this situation look at the solution further below to solve it.

One additional note: if you create a group which has an explicit Deny access privilege to the Desktop and you add the admin user(s) to that group, the Deny might take precedence and  block you out as well.


Set allow permissions for the admin user(s):

Simply go to Control Panel > User > select the user > hit Edit > Applications. In there mark Desktop > Allow and apply the changes.

Set Deny permissions for other user(s):

The easiest way to do this would be to create a group of the users you want to block access (without adding the admin account) and applying a Deny privilege:

Stuck Out of Synology DSM and cannot login?

To solve this you need to have SSH access to your Synology box.

  1. Find your User ID (the first number in the output of the following command – 1026)
    sudo grep admin /etc/passwd
    guest:x:1026:100:admin:/nonexist:/usr/bin/nologin
  2. Connect to SQlite:
    sudo sqlite3 synoappprivilege.db
  3. Determine the user’s current privileges and it should output something like this:
    sqlite> SELECT * FROM AppPrivRule WHERE ID=1026 AND App='SYNO.Desktop';
    0|1026|SYNO.Desktop|0.0.0.0|0000:0000:0000:0000:0000:FFFF:0000:0000||
  4.  Here’s the AppPrivRule table layout:
    0|Type|INTEGER|0||0
    1|ID|INTEGER|0||0
    2|App|varchar(50)|0||0
    3|AllowIP|TEXT|0||0
    4|AllowIPStd|TEXT|0||0
    5|DenyIP|TEXT|0||0
    6|DenyIPStd|TEXT|0||0
  5. Issue the command below, after editing with the correct User ID (1026):
    INSERT INTO AppPrivRule VALUES(0,1026,'SYNO.Desktop','0.0.0.0','0000:0000:0000:0000:0000:FFFF:0000:0000','','');
  6. You should now have access restored.

 

sete

View Comments

  • Thank you for your sharing, the TYPE means 'allow' (0) or 'not allowed' (1) to application/service.
    If the 'users' group is not allowed to desktop, and we want to enable, just run this sql:
    update AppPrivRule set type = 0 WHERE type = 1 AND id = 100 AND App='SYNO.Desktop';

    ;)

    • Thanks for the comment - I guess at the time I was worried with just getting back in the UI and then fixing the settings from there, but that solves it too!

Recent Posts

Synology – Modify public link metadata (site description and keywords)

If you have a Synology DiskStation and you have shared your public NAS link on…

4 years ago

Ubuntu Linux VM on Hyper-V – Expand Virtual disk to full size

Ubuntu initial setup does not do expand the virtual disk image to it's full size.…

4 years ago

Synology DSM 7 Docker error – Container crashes on boot – Solution / Fix

A common issue that appeared with DSM 7 is that some well known containers started…

4 years ago

Windows Sandbox – How to install Windows Store apps

The Windows Sandbox image is useful for many test setups, but it lacks much of…

5 years ago

Windows 10 Snip & Sketch app fails – “Failed to open the file” error fix

If you're used to Snip & Sketch for adding some scribbles placed over desktop screenshots,…

6 years ago

How to solve “Contacting the server for information” in Microsoft / Office 365 apps

On some occasions Microsoft 365 Office applications might open a popup with "Contacting server for…

6 years ago