Forum Discussion
Need script to create users on F5 BIGIP
Hi,
I need script to create users on F5 BIGIP. I have recently got request to create 100 about users on BIGIP. Thought if this task could be automated via scripting. Since creating manually would be Herculean task. I would be using local authentication.
- Hannes_RappNimbostratus
Hello,
Are your F5 appliances v11.5.1 or newer? If so, you could use the iControlREST API for this task. If older, then you will have to use the legacy iControl or a SSH-based script which runs the TMSH commands on-appliance for creating the users. If you go with SSH-based script, I recommend Python Fabric library as it will make SSH session I/O management a lot easier.
Coming back to v11.5.1 or newer. If possible go with the iControlREST API since it will be the cleanest automation solution. SSH-based scripts are often referred to as "dirty workarounds". In regards to exact API call for creating new users, you can use the code below; build a for-loop in your favourite scripting language to go over all F5 appliances.
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://x.x.x.x/mgmt/tm/auth/user -d '{"name":"newuser","password":"newuserpass","role":"admin","partition-access":"all","shell":"bash"}'
Good luck!
- Stanislas_Piro2Cumulonimbus
you can create a user with command:
tmsh create auth user `Username` password `Pass` partition-access all role admin shell bash
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com