Adding users with 2FA via ansible or commandline

tuxis

Famous Member
Jan 3, 2014
233
195
108
Ede, NL
www.tuxis.nl
Hi,

We run quite a lot of clusters on which we configure a AD-Realm that users our AD-setup to authenticate our personnel. We also use 2FA (OTP) for our realm. I add users with
Code:
  command: pvesh create /access/users --userid "{{ item.userid }}"@TuxisIE --groups Administrators --firstname "{{ item.firstname }}" --lastname "{{ item.lastname }}" --keys "{{ item.fakeys }}"

This works for the 'old school' 2FA, but the 'new' setup uses 'x!oauth' for --keys and sets keys in /etc/pve/priv/tfa.cfg.

Is there a way to configure that automagically using the cli, without requiring the actual password and challenge/response is the API?
 

About

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!