Two-Factor Authentication in DirectAdmin โ
Two-factor authentication (2FA) adds a second verification step to DirectAdmin logins. Even if a password is compromised, an attacker can't log in without the time-based code from an authenticator app.
Enabling 2FA for your account โ
- Log into DirectAdmin.
- Click your username at the top right โ Two-Factor Authentication.
- Click Enable Two-Factor Authentication.
- Scan the QR code with an authenticator app โ Google Authenticator, Authy, or 1Password all work.
- Enter the 6-digit code shown in the app to verify it's working.
- Click Verify and Enable.
- Save the backup codes shown โ store them somewhere safe. These let you log in if you lose access to your authenticator app.
Save your backup codes immediately
If you lose your authenticator device and don't have backup codes, you can only recover access via server SSH. Save the codes in a password manager as soon as they're shown. Logging in with 2FA enabled โ
- Enter your username and password as normal
- On the next screen, enter the 6-digit code from your authenticator app
- Click Verify
The code refreshes every 30 seconds. Enter it before it expires.
Requiring 2FA for all users (admin) โ
As Admin you can require 2FA for all resellers and users:
- Admin Level โ Administrator Settings
- Find Two-Factor Authentication
- Set to Required for resellers, users, or both
- Save
Users who haven't set up 2FA will be prompted to do so on next login.
Disabling 2FA (account recovery) โ
If a user has lost their authenticator app and backup codes:
- Log into the server via SSH as root
- Run:bash
# Find the user's DirectAdmin config cat /usr/local/directadmin/data/users/USERNAME/user.conf | grep twofa # Disable 2FA for the user sed -i "s/twofa=1/twofa=0/" /usr/local/directadmin/data/users/USERNAME/user.conf - The user can now log in with password only and re-enable 2FA
Recommended apps โ
| App | Platforms | Notes |
|---|---|---|
| Authy | iOS, Android, Desktop | Backs up codes to cloud |
| Google Authenticator | iOS, Android | Simple, no cloud backup |
| 1Password | All platforms | Integrated with password manager |
| Bitwarden | All platforms | Open source, free tier available |

