Blog · WebJi® India

SSH Two-Factor Authentication: Lock Down Root Access

Quick answer: SSH Two-Factor Authentication: Lock Down Root Access from WebJi®, billed in INR with 18% GST on the invoice. Email support@webji.services is 24/7 in Hindi and English (average first reply under 60 minutes). Phone +91 141 4941811 is business hours only. The company has been in this business since 2005.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Indian trader monitoring candlestick charts on multiple screens in evening light — ssh two factor authentication

Why passwords alone fail

The strongest practical combo is SSH key plus TOTP — the key proves possession, the authenticator code proves presence:

  1. Install the PAM module — sudo apt install libpam-google-authenticator on the server.
  2. Enroll — run google-authenticator as your user; scan the QR into your authenticator app and SAVE the scratch codes.
  3. Wire PAM — add auth required pam_google_authenticator.so to /etc/pam.d/sshd.
  4. Wire sshd — set AuthenticationMethods publickey,keyboard-interactive and ChallengeResponseAuthentication yes, then restart sshd.
  5. Test golden-rule style — open a NEW terminal and connect; keep the working session open until the new one proves out.

Why bother: password-only SSH is guessable, replayable and permanently brute-forced on every public IP. Server hygiene starts on a proper box — see the VPS server tiers — and user setup is in the add sudo user guide.

The strongest combo: key plus TOTP

The strongest combo: key plus TOTP. Do the change this heading names on one site first, then check it in a private browser window or in the mail client, depending on the topic. Change one setting at a time, and undo it if the result is wrong before you try the next. If you want the Jaipur desk to look with you, email support@webji.services — that mailbox is staffed 24/7 in Hindi and English. Phone +91 141 4941811 is business hours only.

Indian trader monitoring candlestick charts on multiple screens in evening light — ssh two factor authentication

Step 1: install the PAM module

install the PAM module. Do this on one site or a staging copy first, then check the public URL in a private window so cache does not hide the result. Stop if the page errors, and email support@webji.services with the step name and the exact error before you repeat it on every account. WebJi® support mail is staffed 24/7 in Hindi and English; the phone line +91 141 4941811 is business hours only.

Step 2: enroll your authenticator app

enroll your authenticator app. Do this on one site or a staging copy first, then check the public URL in a private window so cache does not hide the result. Stop if the page errors, and email support@webji.services with the step name and the exact error before you repeat it on every account. WebJi® support mail is staffed 24/7 in Hindi and English; the phone line +91 141 4941811 is business hours only.

Step 3: sshd_config changes

How this plays out with publickey plus keyboard-interactive: settings that look cosmetic usually decide page speed and uptime under real traffic. The defaults WebJi® ships are tuned for Indian network conditions, and support can review your setup on request.

Step 4: test before closing your session

test before closing your session. Do this on one site or a staging copy first, then check the public URL in a private window so cache does not hide the result. Stop if the page errors, and email support@webji.services with the step name and the exact error before you repeat it on every account. WebJi® support mail is staffed 24/7 in Hindi and English; the phone line +91 141 4941811 is business hours only.

Locked out? Console recovery and fail2ban pairing

Locked out anyway? The recovery ladder: one — scratch codes, the one-time codes stored at enrollment; two — the kept-open session you preserved during setup (this is why the golden rule exists); three — the provider's out-of-band console (VPS panels ship a VNC/serial console that bypasses SSH entirely), which lets you comment the PAM line and back in.

Fail2ban pairs naturally with TOTP: rate-limit repeated failures so brute-force noise never reaches the second factor. Document your recovery path before you need it — a 2FA setup without a tested recovery route is a future lockout with extra steps, not a security control.

Frequently Asked Questions

How do I enable 2FA for SSH on Ubuntu?

SSH Two-Factor Authentication: Lock Down Root Access. Email support@webji.services is 24/7 in Hindi and English, average first reply under 60 minutes. Phone +91 141 4941811 is business hours. If the question is about your own account, open a ticket at https://billing.webji.in/submitticket.php?step=2&deptid=10.

What is the most secure SSH setup?

Why bother: password-only SSH is guessable, replayable and permanently brute-forced on every public IP. Server hygiene starts on a proper box — see the VPS server tiers — and user setup is in the add sudo user guide .

Can I use Google Authenticator for SSH login?

For “Can I use Google Authenticator for SSH login”: The strongest practical combo is SSH key plus TOTP — the key proves possession, the authenticator code proves presence:

Should I use SSH keys and 2FA together?

SSH Two-Factor Authentication: Lock Down Root Access. Email support@webji.services is 24/7 in Hindi and English, average first reply under 60 minutes. Phone +91 141 4941811 is business hours. If the question is about your own account, open a ticket at https://billing.webji.in/submitticket.php?step=2&deptid=10. The question here is: Should I use SSH keys and 2FA together.

What if I lose my 2FA device for SSH access?

What if I lose my 2FA device for SSH access refers to the subject of this page, SSH Two-Factor Authentication: Lock Down Root Access. WebJi® has provided this class of service from Jaipur since 2005, with GST invoices and 24/7 email at support@webji.services. Use the sections and the table on this page for the specifics, and open a ticket at https://billing.webji.in/submitticket.php?step=2&deptid=10 if your case does not match the standard row.

Does fail2ban work with SSH 2FA?

Yes. your city businesses are served online by the Jaipur team, same as clients everywhere else. About 99% of clients never visit. There is no walk-in office in your city. The walk-in office is only in Jaipur. Billing is INR with GST, and email support@webji.services is 24/7 in Hindi and English.

Is WebJi® an Indian company?

Yes. WebJi® is headquartered in Jaipur, Rajasthan and has operated since 2005. Billing, support and governance all run from India.

Do you provide GST invoices?

Every purchase and renewal gets a GST invoice with our GSTIN, and hosting prices are quoted exclusive of 18% GST. Claim input credit as applicable.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →