Forum Discussion

2 Replies

  • you can create a user with command:

     

    tmsh create auth user `Username` password `Pass` partition-access all role admin shell bash
    

     

  • 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!