OPNsense Forum

English Forums => General Discussion => Topic started by: naltalef on January 09, 2023, 04:26:00 pm

Title: disable user from cli
Post by: naltalef on January 09, 2023, 04:26:00 pm
Hi. Good 2023 for all !

I would like to know if it is possible change user properties from the command line.

I have a client with about 200 openvpn users and the idea is to disable all users who have not used openvpn for a while, running a script by cron each week.

Many thanks in advance
Norberto

Title: Re: disable user from cli
Post by: EdwinKM on January 09, 2023, 07:29:06 pm
You checked the opnsense API? https://docs.opnsense.org/development/api.html
There also some Ansible libraries supporting opnsense.
Title: Re: disable user from cli
Post by: franco on January 10, 2023, 03:08:08 pm
There is no user/group API yet. We're discussion inclusion within the year but it hasn't been decided yet. IPsec is the first one to get an API (with 23.1) and then perhaps OpenVPN will follow in 23.7...


Cheers,
Franco
Title: Re: disable user from cli
Post by: naltalef on January 12, 2023, 09:18:43 pm
Thanks for the answers.
A custom script would be a workaround while the API for users and groups is not available.
Any suggestion to take as a base?
As far as I can see, the value <disabled>1</disabled> is added in conf.xml and the password in master.password is changed to *LOCKED**

Many thanks