2FA issue

stanthewizzard

Dabbler
Joined
Sep 6, 2019
Messages
11
Hello

2FA was working well.
Now I'm unable to login.
Through shell I reseted my root pass. Disabling 2FA.
I can login.

Reverted my root password to the old password. Logout. Login without issue.
Enable 2FA (stored in authy and 1password) using QRcode.
I can't login anymore

Thanks for help
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
@stanthewizzard I have the same issue. Did you managed to find a solution? Could you please tell me the command to disable 2fa via command line?

Thank you
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
Hi,

I have managed to reset the root password via ssh but I cannot figure out how to remove 2FA. Can you please tell me how you did it?
 

Mario1971

Dabbler
Joined
Jul 14, 2019
Messages
40
Hello I have the same problem here. TrueNas 12.0-U6. It works after a system reboot without any problems. Then after 3 days of system runtime it does not work again. Do you have a solution for the problem? Or reported a bug?
If you have accsess true the Shell you can enter: midclt call auth.twofactor.update '{"enabled": false}'
to disable the 2FA.
Many greetings Mario
 

Mario1971

Dabbler
Joined
Jul 14, 2019
Messages
40
Ok thanks! I have read through the topic, unfortunately it does not fit with me. The times are syncronized. No time offset. Unfortunately, it no longer works.
 

Mario1971

Dabbler
Joined
Jul 14, 2019
Messages
40
Ah ok, sorry, I used that command and it worked. Unfortunately I can no longer use the 2fa. Is probably a bug in TrueNas. Many greetings Mario
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hey guys,

All of you have probably the same problem : your TrueNAS servers and your 2FA devices are out of sync. TOTP means TIME-based one time password. If your clocks are even only 30 seconds aparts from each others, 2FA will fail.

As a 2FA device, the use of a smartphone ensure that this one will have the correct time. Smartphones requires very precise time and they always sync time with the cell network. As for the TrueNAS server, you must ensure that it syncs successfully over NTP with official references. If you use a computer as a client, you must also sync it over NTP to ensure its time is accurate.
 

Dave Hamby

Dabbler
Joined
May 16, 2017
Messages
44
This seems to be a common problem. I set up the account in 1Password, setup 2FA and set up 2FA in 1Password. Logged out, logged in verifying the password and 2FA. Later I came back and could not log in. I resolved the issue by resetting the password using physical console option 7. Now verifying WebUI. Will leave 2FA off for now.
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
@Heracles you were 100% correct. I looked at the time on the TrueNAS server and I was out of sync by 40 seconds. Thank you
 
Last edited:

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
I have set up NTP with the following:

1634313740315.png

I welcome any advise of there are better NTP servers to use
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Good that you fixed your problem @Fred974.

As for NTP, all of your references are pretty generic or global... Google, Cloudflare, ...

NTP is sensitive to latency and for that reason, better for you to take references that will be closer to you. The French government may have some public time references. Local universities and others may also have some.

Your actual config and reference will be up to the task, but as you asked if there is even better, actually there is.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399

Dave Hamby

Dabbler
Joined
May 16, 2017
Messages
44
I hadn't thought to check time. NTP or PTP and well behaved host OS should take care of it.

I did find an issue at Apple support where hosts supposedly synced to time.apple.com were 3 minutes out of sync with hosts synced to Cisco's time servers. The Apple hosts were iPads and iPhones. I suspect that the time is right but that the applications, when put in the background, are not keeping up. With iOS 15, I'm seeing the clock widget jump to sync after going time late while off-screen. I'm also seeing the same behavior in my Apple watch face.


I've added time.apple.com to the NTP servers. GPS referenced NTP servers are very affordable now. Nobody should be offering time service without them.

I've found I have to wait a FIDO cycle with many hosts for FIDO app to catch up. Semantic VIP used by USAA was notorious.
 

Dave Hamby

Dabbler
Joined
May 16, 2017
Messages
44
I've re-enabled 2FA and verified I can log in. Letting it sit a while to comfirm the FIDO cycle hypothesis mentioned above. Will see if the issue happens using the 1Password app vs the 1Password Firefox plugin.
 

asw2012

Contributor
Joined
Dec 17, 2012
Messages
182
I would like to ask, if we get locked out and our 2FA device (to generate 6digit code) is no longer working, are there any backup codes that can be generated? (similar to some popular apps, like nextcloud 2FA or Instagram 2FA)
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hey @asw2012,

Here, I authenticate to SSH using public key. As such, it is both strong and not related to TOTP.

The physical consol on the server is another option : you can connect to it without authentication (unless you manually configured it differently).

So these are the workaround whenever you can not complete TOTP.
 
Top