Remove Abnormal User from Synology NAS

Some time ago the Synology Health Monitor started giving me a warning with error message "one or more abnormal users have been found in the authentication file". In my case it was a leftover from an old package I installed (Couchpotato) which created a user that was now irrelevant. I needed to find a way to remove it, so here are the steps I followed:

Step 1: Access Synology NAS via SSH

Step 2: Gain root access to your Synology NAS

Step 3: Locate and optionally backup files that will be edited

First of all, we need to locate /etc/passwd and /etc/shadow, the two files we will later on edit to remove the abnormal user(s)

  1. Type cd /etc to enter in the etc folder
  2. Type ls to list the files contained in the folder. You should see passwd and shadow
  3. (Optional) Make a backup of these files just in case you mess things up. To do this, type cp passwd bkp-passwd and cp shadow bkp-shadow. This will actually copy the files into new files (named bkp-passwd and bkp-shadow) stored in the same folder as the original. In addition to this, I also made backups of passwd- passwd.cfgen.bkp and shadow.cfgen.bkp using the same naming convention (putting bkp- in front of the filename).

Step 4: Remove abnormal user(s)

  1. Type vim passwd to edit the file passwd. You will see the full content of the file.
  2. Type i to enter edit mode (called --INSERT--)
  3. Delete the line(s) relative to the abnormal user(s). In my case it was couchpotatoserver-custom.
  4. Press Esc to exit edit mode
  5. Type :wq to save changes and quit
  6. Repeat Step 4 for the file shadow
  7. (Optional?) I also removed the abnormal users from the files passwd- passwd.cfgen.bkp and shadow.cfgen.bkp

Step 5: Rebuild user database

  1. Type synouser --rebuild to rebuild the user database
  2. Type synouser --get <USERNAME> (where <USERNAME> is the name of the abnormal user you removed). This step should check if the user still exists.

If the terminal outputs something like this, it means you did everything correctly

synouser --get tvheadend Lastest SynoErr=[user_db_get.c:36] synouser.c:353 SYNOUserGet failed. synoerr=[0x1D00]