How to enable Totp in Nextcloud?

Attempting to enable totp for nextcloud, when log into nextcloud as admin account, in settings there are only the basic user settings no admin settings to enable apps. I tried to install the totp with “snap run nextcloud.occ app:install twofactor_totp” which resulted in message that it is already installed. Seems like nextcloud is not recognizing the admin account but only as a standard user account. Any suggestions on how to correct this? Thanks.

Usually if you activate device with a user that user becomes an admin later when you install Nexcloud.

Do you have multiple users on device created with Users app or have you reactivated the device after installing Nextcloud?

Could you post the output of these commands:

snap run nextcloud.psql -c "select * from oc_ldap_group_mapping"
snap run nextcloud.psql -c "select * from oc_ldap_group_members"

There is a was to reset admin permissions

snap run nextcloud.psql -c "update oc_ldap_group_mapping set owncloud_name = 'admin'"

snap run nextcloud.psql -c "update oc_ldap_group_members set owncloudname = 'admin'"

I am logging into nextcloud using the same admin account originally used to activate syncloud. I have added other users through the "users’ app. If i log into nextcloud with a user or the admin account the setting options are the same. In nextcloud under privacy it does correctly list the administrator account name/icon but just doesn’t display the admin options.
See attached output from requested commands. (not sure if any of the user info should be treated as sensitive.) It does correctly identify the admin account id.

I also tried the bottom two commands, both resulted in same error of duplicate and that key already exists.

Can you post a screenshot of the menu when you click your user top right corner?

This is the admin account when I click on top right icon, and also the menu options once settings is clicked.

Right this does not look like admin, are you sure this user name is in the list above with “admin” on its line (second list 3rd line)

I also just re-read your first comment.
" or have you reactivated the device after installing Nextcloud?"
The device was first activated, then users added, then nextcloud installed and setup. The device has not been reactived ever, so it has not been reactivated after installing nextcloud.

Yes, the admin menu looks no different than the other users, it is the same id listed next to admin from the output above. It is the same id that I originally activated the device on and it is the same id I can use to configure all users in the “users” app.
I have tried logging into nextcloud as all five users shown in the output from above image and all settings menus look the same, the one that matches the admin does not look any different.

One thing to try is temove Nextcloud and install again.

If that does not help, reactivate device (that will remove users), install nextcloud (make sure admin features are there), add users with Users app.

All users files will be there if they have the same name (you may need to do occ files scan)

Ok, I have uninstalled, reinstalled nextcloud with no change, I will try to reactivate device tomorrow and set how that works, thank you.

Just to update, I have it sorted now but reactivating wasn’t enough, after reactivating then attempting to install nextcloud, the installation would only show the spinning circles, then after a few minutes stop showing the circles and Nextcloud would not be installed. The log showed the error that “username is invalid because files already exist for this user.” (this is with external storage disconnected and no users added.)

I ended up having to reimage the sd card to get Nextcloud to install, after that I could log in to Nextcloud and have access to the admin settings. After updating the system and installer, next I reconnected my external storage and select activate but that would result in error but the activate bar would turn green, running the occ command to scan all would still only return a result of the basic files/folder of a default new user, not all files actually on the external drive. I manually deleted 5 or 6 folders in /external/nextcloud/ named appdataxxxxxxx so only user folder files were left.
After restarting the system then adding users now the storage was recognized correctly and each account when logging into nextcloud showed all previously added files correctly without having to run scan command. As nextcloud admin now, TOTP is enable and working as well.