Are you an LLM? You can read better optimized documentation at /docs/troubleshoot/server/two-factor-stopped-working.md for this page in Markdown format
2FA Stopped Working ​
It is usually a time synchronization issue.
Diagnosis ​
- Check your server's time with
date- if the time is off, you need to synchronize it. - Check your NTP configuration with
cat /etc/ntp.conf. - Check with
systemctl status systemd-timesyncd.serviceif your operating system is using systemd to synchronize time. - Check your firewall (
ufw,iptables) rules to see if you have any rules that block time synchronization ports (123/udp, 123/tcp).
Solution ​
- If your operating system is using systemd, you can synchronize the time with
sudo timedatectl set-ntp true. - If your operating system is not using systemd, you can synchronize the time with
sudo ntpdate ntp.ubuntu.com.
