How to enable TFA for SSH?


Jun 20, 2015
Hello everyone!
I've read several times on this forum that people are using TFA for SSH but I can't find that option.

I've configured TOTP for the root user and enforce OATH on both pam and pve realms.

Still, when I try to connect via SSH (via Putty) nothing asks me for a TOTP; username and password suffice.

What are the necessary steps to make TOTP for SSH mandatory?

Thanks in advance!
Hi, I don't understand your answer.

If you're saying that Proxmox should ask me for TOTP after setting it up via Web GUI when I try to connect via Putty by default: It doesn't.

Can anybody describe the necessary steps to make sure that TOTP will be required when connecting via SSH?

EDIT: You can answer in German as well, if that's easier.
You've added your question in the English part so... :D

TOTP from Proxmox is only for the webinterface, not for the cli. If you would like to have TOTP also for the cli follow the instruction on the link and begin at point "4.2. Example 2: use Google Authenticator" Every thing is on pve, nothing to compile.
Thanks for clarifying! Is there a way to reuse the secret key from the Proxmox Web GUI with libpam-google-authenticator? It doesn't look like I could force my own key =/...
So I tried doing it backwards: Use the key generated in google-authenticator for Proxmox Web GUI. But then I get the error:

Parameter verification failed. (400)

key: value does not match the regex pattern

My guess is that Proxmox Web GUI requires a key of shorter size. The google-authenticator generated key is longer.

So either I need to find a way to put the Proxmox Web GUI key into google-authenticator or I the Proxmox Web GUI has to accept longer TOTP secret keys.

Any ideas?


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!