Hide system accounts in Nextcloud

is there a way to hide the system accounts from user listings in Nextcloud pls? e.g. ldap user, admin user etc.


An option could be to filter users and groups from Nextcloud LDAP/AD connection settings (Settings -> Administration: LDAP/AD integration), when logged in as nextcloud’s admin. But prior to any change better take note of current/working settings:

sudo -u apache /opt/rh/rh-php71/root/usr/bin/php /usr/share/nextcloud/occ ldap:show-config

@dnutan, thanks for that. However, I would need some handholding for LDAP in general is not my cup of tea…


We are on the same page, I’m afraid… Someone more familiar with LDAP shall be able to provide better guidance, but here’s my try.

If you’re using Active Directory, you can try with this Users LDAP Query:


where (&(|(objectclass=person))) is the default filter
and (|(!(sAMAccountName=ldapservice))) is an exclusion (!) filter.

If you don’t care about groups and want to get rid of them from listings, go to Groups and uncheck group from Only these object classes filter (or choose specific groups).

Note users matching the Login Attributes ldap query would be able to log in even if not listed as Users:

In order to control which LDAP users can login to your Nextcloud server use the Login Attributes tab. Those LDAP users who have access but are not listed as users (if there are any) will be hidden users.)