Two-Factor Authentication in DirectAdmin
How to enable and manage two-factor authentication for DirectAdmin admin, reseller, and user accounts.
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
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:
# 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 |