Enabled Two-Step Authentication for admin user, used google authenticator to capture the QR code. But not sure why the 2fa wont work. Had to reset the admin password, any pointers on why its not working, I tried to set my phones timezone to UTC to see if that would work but no luck. Help is appreciated thanks
Check the timezone and time of both the server and device generating the code. It’s possible for the time to be correct but the timezone to be incorrect. The OTP generation converts the time to UTC so if the timezone is incorrect the conversion will be inaccurate.
Was able to fix it, does not matter timezones just make sure
Fix time sync on the server:
- Install and configure NTP (
chronyd
orntpd
) on the server. - Use commands like
chronyc sources -v
andchronyc tracking
to confirm the server is syncing properly to NTP servers.
Force time synchronization:
- Run
sudo chronyc makestep
to immediately sync the server clock if it’s out of sync.