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)
- Type
cd /etcto enter in the etc folder - Type
lsto list the files contained in the folder. You should see passwd and shadow - (Optional) Make a backup of these files just in case you mess things up. To do this, type
cp passwd bkp-passwdandcp 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)
- Type
vim passwdto edit the file passwd. You will see the full content of the file. - Type
ito enter edit mode (called--INSERT--) - Delete the line(s) relative to the abnormal user(s). In my case it was
couchpotatoserver-custom. - Press Esc to exit edit mode
- Type
:wqto save changes and quit - Repeat Step 4 for the file shadow
- (Optional?) I also removed the abnormal users from the files
passwd- passwd.cfgen.bkpandshadow.cfgen.bkp
Step 5: Rebuild user database
- Type
synouser --rebuildto rebuild the user database - 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]