Cannot delete/disable admin user account

Nextcloud version (eg, 12.0.2): 17.0.2
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.1): 7.2.24

The issue you are facing:
I cannot delete/disable the user account ‘admin’, even after removing the user from the ‘admin’ group.

I want to do that to prevent attempts to brute force into the account.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Go to ‘Users’
  2. Check the ‘admin’ user
  3. There is not the 3 dots button on the right of the quota settings.

Reproduceable also on NC 16.0.7: Created a test user with username “admin” (uid: admin) - no group, no mail, no files uploade, never logged in, just got a password.
=> Created, cannot be deleted as there are no 3 dots available.

Possible workaround: Use occ user:delete command:

sudo -u www-data php occ user:delete admin

Attention: This does, what it should, it delete’s the user and all the files for userid “admin” without any questions and confirmations. Do not try this on production unless this is what you want.

If you are logged in as the user you are trying to delete and unable to do so, this is, as far as I am aware, by design.

Using the NC Admin GUI simply create your new admin user, log-in as the newly created admin user and delete the unrequired user.

If you are comfortable with the command line you can create and delete the users from there as @powerfox noted.

User Commands: https://docs.nextcloud.com/server/17/admin_manual/configuration_server/occ_command.html#user-commands-label

@NeptuneUK the problem is, if you create a user with userid “admin”, you cannot delete this user using the NC Admin GUI even if you log in as another (admin) user. You only can delete it by using the commandline. Try yourself :slight_smile:

I had the same problem in NC 18.0.3, but it went away for me after updating to 18.0.4, the three dots were now there for the admin user and I was able to delete it.

1 Like

@bennypr0fane you’re right, it’s workin in web GUI now as well, thank you for this information

Thank you, now I can both disable or delete it