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.

Secure your account with two-factor authentication

Client Area (cp.gozenhost.com)

  1. Log into the client area
  2. Click your name (top right) → Security Settings
  3. Under Two-Factor Authentication, click Enable
  4. Open your authenticator app:
  5. Scan the QR code
  6. Enter the 6-digit code to confirm
  7. Save your backup code somewhere safe

cPanel

  1. Log into cPanel
  2. Go to Security → Two-Factor Authentication
  3. Scan the QR code with your authenticator app
  4. Enter the 6-digit code
  5. 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:

PromptRecommended 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
  

Which Authenticator App?

AppMulti-DeviceCloud BackupFree
Google Authenticator✓ (sync via Google account)✓✓
Authy✓ (mobile apps only)✓✓
1Password✓✓Paid
Bitwarden✓✓TOTP in the vault needs Premium

What to Do Next

Last updated 21 Oct 2026, 00:00 +0300. history

Was this page helpful?