Big problem with Two Factor authentication for Nextcloud and Webtop 5

Hello friends,

after a crash I had to reset my iPhone and also had to re-play the Google Authenticator, which I used for the two-factor authentication. Now it is no longer possible to access Webtop or Nextcloud. How can I disable the two factor authentication via putty?

Thanks you for your help.

Uwe

If there is no other admin user that can authenticate, on Nextcloud you can disable 2FA using occ command. To temporarily disable 2FA for a specific user:

su - apache -s /bin/bash -c "source /opt/rh/rh-php71/enable; cd /usr/share/nextcloud/; php occ twofactor:disable <username>"

Another option for nextcloud would be to disable the 2FA appā€¦

For webtop5:

su - postgres -c 'psql webtop5'
UPDATE "core"."settings" SET "value"='false' WHERE "key"='otp.enabled';
\q

Afterwards you may have to trigger:

signal-event nethserver-webtop5-update
4 Likes

Thank You so muchā€¦ this saved my day too!

3 Likes

I have to ask one more questionā€¦ how would i go about enabling the 2 factor authentication againā€¦
since when i enable it again it does not seem to reset to default settings. So i canā€™t login again
Maybe I am missing something.
Any help is greatly appreciated!

For Nextcloud or Webtop?

webtop

A small correction, the above commands disable OTP globally and gray-out OTP userā€™s settings, if Iā€™m not mistaken. Same as admin can do from WebTop system properties.

As admin, from Domains > NethServer > Users you can right-click on a user and select Settings from context menu, then access userā€™s OTP settings and deactivate it for that user.

To disable OTP for a specific user (or the admin), from the command line:

su - postgres -c 'psql webtop5'
UPDATE "core"."user_settings" SET "value"='false' WHERE "key"='otp.enabled' AND "user_id"='theusergoeshere';
\q

No signal-event required.
Later on, either the user or the admin can reconfigure OTP settings.

4 Likes

Sorry it took me so long to test this solution,
worked like a charm! Thank You!!

Thanks for reporting. Another :medal_sports: for @dnutan :slight_smile:

1 Like