First, create a REST API administrator by referring to this article: Technical Tip: How to create a REST API Admin user and assign it to an admin profile. In this example, a 'curl' command was used to change an admin password.
curl -kv -X POST "https://192.168.1.99/api/v2/monitor/system/change-password/select" -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -d "{'mkey': 'admin', 'old_password': '<oldpassword>', 'new_password':'<newpassword>'}"
Replace <token> with the actual API token. Replace <oldpassword> with the current super admin password. Replace <newpassword> with the desired new super admin password. Replace https://192.168.1.99 with the URL for accessing the FortiGate GUI including port number if not using 443. Replace 'admin' with the admin username for which the password will change.
Note: Make sure the REST API admin has enough privileges (Administrator profile) to change the password. Related article: Technical Tip: How to change local user's password using API
|