Next Cloud password reset

Discussion in 'Server Operation' started by SSK, Jul 30, 2020.

  1. SSK

    SSK Member

    We have Nextcloud, part of lxc containers. It has been a while since we used backup codes and now we have gotten logged/locked out after we activated the two-way authentication. Could someone suggest a way to reset the settings? Note: this is part of a subdomain and placed under the lamp server container. Thanks in advance to the community for getting into this discussion.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member

    This ended up in the wrong forum, this one is for ISPConfig development.
     
  3. SSK

    SSK Member

    @jesse: Should I then re-post it? As this pertained to container and server management, which forms the fulcrum and focus of back-end developers, I thought that this might fit here.
     
  4. SSK

    SSK Member

     
  5. SSK

    SSK Member

    Could you share the one where I need to post this one? There are several of those.
     
  6. Jesse Norell

    Jesse Norell Well-Known Member

    That or wait and @till can probably move it.
     
  7. Jesse Norell

    Jesse Norell Well-Known Member

    There are only forums for ISPConfig and general Linux admin/programming type stuff, so probably there isn't a good one for how to regain access to nextcloud, but Server Operation might be the most generic? A quick google search finds https://help.nextcloud.com/ and other sites that would be more relevant, but you could try there.
     
  8. SSK

    SSK Member

    Ok and Thanks. I also submitted this question over at Nextcloud. As this pertained to container, lamp and ISPConfig, I decided to share over here as well.
     
  9. Th0m

    Th0m Active Member HowtoForge Supporter

  10. SSK

    SSK Member

    Thanks. Yes, I restarted the container and server. I even tried this command from the command line prior to starting this thread.
    Command tried: sudo -u www-data php /var/www/nextcloud/occ app:enable twofactor_totp

    On the positive end, I was able to locate the folder named backupcodes under Nextcloud. However, I could not still figure out a way to reset the backup codes within the container server. I again tried a version of the above command right within the nextcloud folder without much luck. Any additional suggestions would be appreciated.
     
  11. Th0m

    Th0m Active Member HowtoForge Supporter

    You should disable the app, not enable it
     
  12. SSK

    SSK Member

     
  13. SSK

    SSK Member

    @Th0m: Thanks again.
    I did not share the complete list of commands tried. Here is the latest one tried, along with the error.
    sudo -u www-data php occ twofactor:disable admin
    error: failed to open stream: Permission denied on 11 in occ file
     
  14. SSK

    SSK Member

    One more tried right where the OCC file and data folder is -
    sudo -u data php occ twofactor:disable admin
    sudo: unknown user: data
    sudo: unable to initialize policy plugin
     
  15. Th0m

    Th0m Active Member HowtoForge Supporter

    Can you run
    Code:
    ls -l
    on the nextcloud folder?
     
  16. SSK

    SSK Member

    Here is the path where nextcloud is located within the container lamp-1-dns-1.
    /var/lib/lxd/containers/lamp-1-dns-1/rootfs/var/www/clients/client2/web11/web

    this is where the occ file is.

    Folders and files under this directory:
    3rdparty config core index.html occ ocs-provider resources status.php version.php
    apps console.php cron.php index.php ocm-provider public.php robots.txt themes
    AUTHORS COPYING data lib ocs remote.php stats updater
     
  17. Th0m

    Th0m Active Member HowtoForge Supporter

    Run this command:
    Code:
    sudo -u web11 php /var/www/clients/client2/web11/webocc app:disable twofactor_totp
     
  18. SSK

    SSK Member

    I tried this command right from the above-mentioned path and also from the parent folder to web (web11). which should not matter with the complete path mentioned in your command and got the following error for both the cases:

    sudo: unknown user: web11
    sudo: unable to initialize policy plugin
    Please note that I am resetting the password for the admin. I also tried admin instead of web11, which also resulted in the same error.

    Quick note: /web11/web/data has a list of all users incl. admin.
     
  19. Th0m

    Th0m Active Member HowtoForge Supporter

    You have to run it inside of the container.
     
  20. SSK

    SSK Member

    Got it, I think. I am into the container and ran the command within the container, which is what you meant in your reply, I guess,

    sudo -u web11 php /var/www/clients/client2/web11/web/occ app:disable twofactor_totp
    No such app enabled: twofactor_totp
     

Share This Page