Skip to content
Security2 min read

What is two-factor authentication (2FA)?

Short answer

Two-factor authentication (2FA) is a login method that requires two different factors: something you know, like a password, and something you have, like a one-time code from a phone app or a security key. Even if the password is stolen, an attacker can't log in without the second factor.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Authentication factors
  2. Common methods and how safe they are
  3. How an authenticator app (TOTP) works
  4. Common mistakes
  5. On ArabyHost

Passwords get stolen in many ways: a leak from another site, a phishing page, spyware, or a brute-force attack. Two-factor authentication makes a stolen password worthless on its own.

Authentication factors

  • Something you know: a password or PIN.
  • Something you have: a phone or a USB security key.
  • Something you are: a fingerprint or face, usually used to unlock the device that holds the second factor.

Common methods and how safe they are

Method How it works Security
SMS A code arrives by text message Acceptable; exposed to SIM swaps
Authenticator app (TOTP) A 6-digit code that changes every 30 seconds Good
Push notification Approve the login with one tap Good; never approve a login you didn’t start
Security key or passkey A device or cryptographic key bound to the site Strongest, and phishing-resistant

How an authenticator app (TOTP) works

When you turn it on, the site shows a QR code containing a secret, such as:

otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

The app (Google Authenticator, Microsoft Authenticator and others) stores that secret and combines it with the current time to produce a new code every 30 seconds. The server does the same calculation; if the codes match, you’re in. That’s why your phone’s clock should be set automatically.

Common mistakes

  • Not saving backup codes, then losing the phone.
  • Protecting the site but not the email: whoever controls your inbox can reset most passwords, so secure email first.
  • Sharing the code with someone who calls claiming to be support. No real support team ever asks for it.
  • Neglecting the password once 2FA is on: a second factor doesn’t replace a strong, unique password; make one with the password generator.
  • Relying on SMS for critical accounts such as email and your domain registrar; an authenticator app or security key is better.

On ArabyHost

Start by protecting the email address tied to your ArabyHost account, since password-reset messages go there. Turn on 2FA for WordPress admins with a trusted plugin as described in the secure WordPress guide, and on your GitHub account if you deploy from it. On AI/Developer plans, use an SSH key instead of a password to log in to the server.

FAQ

What if I lose the phone with my authenticator app?

Use the backup codes you saved when you turned 2FA on. That's why they should be printed or kept in a password manager, not only on the phone itself.

Is SMS safe for two-factor authentication?

It's better than no second factor, but it's the weakest method, because an attacker can move your number to another SIM (SIM swap). Authenticator apps and security keys are stronger.

What's the difference between 2FA and MFA?

2FA means exactly two factors; MFA (multi-factor authentication) means two or more. In everyday use they usually mean the same thing.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.