Enabling Two-Factor Authentication
Add 2FA to your GoZen Host client area, cPanel, and SSH logins so a stolen password isn’t enough to get in.
3 min read
Passwords leak through phishing and data breaches. With Two-Factor Authentication (2FA), a stolen password isn’t enough to log in, because each login also needs a code from your phone.

Client Area (cp.gozenhost.com)
- Log into the client area
- Click your name (top right) → Security Settings
- Under Two-Factor Authentication, click Enable
- Open your authenticator app:
- Google Authenticator (Android/iOS)
- Authy (multi-device sync)
- 1Password or Bitwarden (built-in TOTP)
- Scan the QR code
- Enter the 6-digit code to confirm
- Save your backup code somewhere safe
Save the backup code. If you lose your phone and don’t have the backup code, you’ll need to contact support and verify your identity to regain access, which can take a while.
cPanel
- Log into cPanel
- Go to Security → Two-Factor Authentication
- Scan the QR code with your authenticator app
- Enter the 6-digit code
- Click Configure Two-Factor Authentication
From then on, cPanel asks for a code after your password on every login.
SSH (VPS / Cloud)
On a VPS you can add 2FA to SSH logins with the Google Authenticator PAM module:
Run the setup as the user who will log in:
google-authenticator
Answer the prompts:
| Prompt | Recommended Answer |
|---|---|
| Time-based tokens? | y |
| Update .google_authenticator file? | y |
| Disallow multiple uses? | y |
| Increase time window? | n |
| Rate limiting? | y |
Scan the QR code with your authenticator app and save the emergency scratch codes.
Configure PAM
sudo nano /etc/pam.d/sshd
Add this line at the top:
auth required pam_google_authenticator.so
If you log in with an SSH key and want the key plus a code (no password prompt), also comment out the password step in the same file:
- Ubuntu / Debian:
#@include common-auth - Rocky / AlmaLinux:
#auth substack password-auth
Configure SSHD
sudo nano /etc/ssh/sshd_config
Find the existing KbdInteractiveAuthentication line (Ubuntu 22.04 and later ship it set to no) and change it, rather than adding a second line. sshd uses the first value it reads, and files in /etc/ssh/sshd_config.d/ are read before the rest of sshd_config, so check there too. Make sure PAM is on:
KbdInteractiveAuthentication yes
UsePAM yes
Older guides use ChallengeResponseAuthentication, which is a deprecated alias for the same setting.
If you use SSH keys and want 2FA:
AuthenticationMethods publickey,keyboard-interactive
Check the values sshd will actually use:
sudo sshd -T | grep -Ei 'kbdinteractive|usepam|authenticationmethods'
Restart SSH:
# Ubuntu / Debian
sudo systemctl restart ssh
# Rocky / AlmaLinux
sudo systemctl restart sshd
Test in a new terminal before closing your current session. If the config is wrong, you’ll lock yourself out.
Which Authenticator App?
| App | Multi-Device | Cloud Backup | Free |
|---|---|---|---|
| Google Authenticator | ✓ (sync via Google account) | ✓ | ✓ |
| Authy | ✓ (mobile apps only) | ✓ | ✓ |
| 1Password | ✓ | ✓ | Paid |
| Bitwarden | ✓ | ✓ | TOTP in the vault needs Premium |
What to Do Next
- First Boot: Initial Server Setup - secure your VPS alongside 2FA
- Connecting to Your Server via SSH - SSH key setup works alongside 2FA
- Free Migration - moving to GoZen from a host without 2FA support? We migrate your accounts intact and you set up 2FA on arrival
Last updated 21 Oct 2026, 00:00 +0300.