I need to enable 2fa for my server and used v-add-user-2fa admin but nothing is outputted? How does it work? Thanks!
That command is just to activate 2fa for that user. If you want to view the QRCODE or Account Key to add it to your 2fa application, visit the user settings.
From command line, you can get the account key using this command:
v-list-user admin json | jq -r '.[]|.TWOFA'
Where can I view and modify user settings, such as QRCODE
The user conf is saved in this file:
/usr/local/hestia/data/users/YourUser/user.conf
Note: Unless you know what you are doing, you should never manually modify this file.
TWOFA=‘’
QRCODE=‘’
Where do the parameters go to generate the configuration? Are these two parameters? Thanks
My secret.php configuration code is like this. It is located in /usr/local/hestia/web/inc/2fa/secret.php
<?php
use RobThree\Auth\TwoFactorAuth;
require_once __DIR__ . "/../vendor/autoload.php";
$tfa = new TwoFactorAuth("Hestia Control Panel");
$secret = $tfa->createSecret(160); // Though the default is an 80 bits secret (for backwards compatibility reasons) we recommend creating 160+ bits secrets (see RFC 4226 - Algorithm Requirements)
$qrcode = $tfa->getQRCodeImageAsDataUri(gethostname(), $secret);
echo $secret . "-" . $qrcode;
It has a problem. I can’t see the QR code and recovery code related content in the web interface. For example, the picture example you provided before. Should I modify this part of the code?
I mean, nothing is displayed when I choose to enable 2fa in the web interface. How should it be configured and set to take effect? Do you need to install Composer on the server for it to work successfully? Thank you!
You need to enable 2FA and then click Save to generate the code and qrcode.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.