Two-Factor Authentication (2FA) in Proxmox VE
Overview
Two-factor authentication adds an extra layer of security by requiring something you know (password) plus something you have (authentication device). Proxmox VE supports TOTP (Time-based One-Time Passwords) and YubiKey.
Enabling 2FA
Via Web UI
- Navigate to Datacenter → Users
- Select user → 2FA tab
- Click Add
- Select authentication type:
- TOTP (Authenticator app)
- YubiKey (Hardware key)
TOTP Configuration
Required Steps
-
Install authenticator app:
- Google Authenticator (iOS/Android)
- Authy (iOS/Android)
- Microsoft Authenticator (iOS/Android)
- 1Password
- Bitwarden
-
In Proxmox:
User → 2FA → Add → TOTP -
Scan QR code with authenticator app
-
Enter 6-digit code to enable
Via CLI (Limited)
# View 2FA status for user
pveum user 2fa list admin@example.com
# Disable 2FA (requires password)
pveum user 2fa delete admin@example.com --method totpYubiKey Configuration
Setup YubiKey
- Connect YubiKey to USB port
- In Proxmox:
User → 2FA → Add → YubiKey - Touch YubiKey when prompted
- Enable 2FA
Using YubiKey
When logging in:
- Enter username and password
- Touch YubiKey button
- Enter code from authenticator app (if using both)
2FA for Specific Users
Enable for Administrators
# Always enable 2FA for admin users
# Via Web UI:
# Datacenter → Users → [admin] → 2FA → Enable TOTPEnable via PAM
For system users (local Linux accounts):
# Edit /etc/pve/user.cfg
# Add 2fa to user configuration2FA Recovery
Recovery Codes
Generate recovery codes before enabling 2FA:
- User → 2FA → Add → TOTP
- Click Generate Recovery Codes
- Save codes securely (print/digital vault)
- Use one code if authenticator unavailable
Recovery Process
If locked out:
- Use recovery code from saved list
- Contact administrator for account recovery
- Administrator can disable 2FA in user settings
Disabling 2FA
# Via Web UI (as admin)
# Datacenter → Users → [User] → 2FA → Delete
# Only admin can disable another user's 2FASecurity Considerations
Backup Authenticator
- Set up 2FA on multiple devices
- Store recovery codes securely
- Use cloud-based authenticator with backup
Hardware Keys
- YubiKey more secure than phone
- Works offline
- Physical possession required
Enterprise 2FA with LDAP
Integration with LDAP for enterprise 2FA:
# Configure LDAP realm
pve realms add ldap --realm ldap.example.com
pve realms update ldap --base-dn "dc=example,dc=com"
# LDAP 2FA requires additional sync configuration