Well I am sure I goofed up good.
After seeing the 2FA option for a while now I decided to enable not knowing anything about it.
I very ignorantly did not write down any of the backup codes it generated thinking it was going to “configure” during my next login.
Welp…it didnt. And now my admin account is locked out. When attempting to log in it asks for the backup codes which I stupidly dont have.
In short…
I ran: (while in nextcloud DIR)
sudo -u apache php occ twofactorauth:disable “user” <–actual user entered w/o quotes
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Not enough arguments (missing: “provider_id”).
Ran:
sudo -u apache php app:update --all
Ran:
sudo -u apache php occ twofactorauth:state “user”
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Two-factor authentication is enabled for user “user”
Enabled providers:
backup_codes
Ran:
sudo -u apache php occ twofactorauth:disable “user” backup_codes
The provider does not support this operation
I still cant get it to my admin account
I even created another account…logged in to make sure it works and it did.
Once i granted admin rights to the newly created account…it then asked for backup codes on next login.
Nextcloud version 15.0.0.10
Version string 15.0.0
Running on centOS-release-7-6.1810.2.el7
Hmm… this is the, usually hidden folder, where ZFS stores it’s snapshots. As I said, this folder usually doesn’t show up, unless you set a specific ZFS attribute named snapdir. What does
cannot open ‘zfs_volume’: dataset does not exist
tried with “name of my dataset” instead of “volume”…same thing
If it helps i have only taken two snapshots since i made the dataset and i dont think they are stored there in the nextcloud folder. i think they are in the root of my zfs pool
can i delete those files since i have verified i dont have any snapshots there?
Ok update done and i thank you for the help however…
[root@ADELL nextcloud]# sudo -u apache php occ twofactorauth:state “user”
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Two-factor authentication is enabled for user “user”
Enabled providers:
backup_codes
[root@ADELL nextcloud]# sudo -u apache php occ twofactorauth:disable “user” backup_codes
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
The provider does not support this operation.
i also ran:
[root@ADELL nextcloud]# sudo -u apache php occ app:update --all
Okay, here we go… grab the user and pw from your config.php and log in to your mariadb instance as the nc user and disable the twofactor apps using this query:
update oc_appconfig set configvalue=‘no’ where appid=‘twofactor_backcodes’ and configkey=‘enabled’;
update oc_appconfig set configvalue=‘no’ where appid=‘twofactor_u2f’ and configkey=‘enabled’;
update oc_appconfig set configvalue=‘no’ where appid=‘twofactor_totp’ and configkey=‘enabled’;
This should disable all of the twofactor apps in your NC instance.
MariaDB [(none)]> alter oc_appconfig set configvalue=‘no’ where appid=‘twofactor_backcodes’ and configkey=‘enabled’;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'oc_appconfig set configvalue=‘no’ where appid=‘twofactor_backcodes’ and ’ at line 1
MariaDB [(none)]> alter oc_twofactor_providers set enabled=‘0’ where provider_id=‘backup_codes’ and uid=’user’;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'oc_twofactor_providers set enabled=‘0’ where provider_id=‘backup_codes’ ’ at line 1
Yeah… my bad… it’s already late over here… your user doesn’t really is named “user”, is it? Anyway, make sure to replace “user” with the actual NC user name:
update oc_twofactor_providers set enabled=‘0’ where provider_id=‘backup_codes’ and uid=’<nc user name>’;
It’s not that’s my futile attempt to retain privacy at this point I dont care
The user is MarkB
So it should be…
pdate oc_twofactor_providers set enabled=‘0’ where provider_id=‘backup_codes’ and uid=’<MarkB>’;
Correct?