Gen 6 API Admin password change
Firmware: 6.5.4.6-83n
Device: Nsa 2650
Request URL: https://192.168.168.168:443/api/sonicos/administration/password/old-password/password/new-password/password123/confirm-password/password123
Return:
{
"status": {
"success": false,
"cli": {
"mode": "administration_mode",
"depth": 2,
"command": "admin-password old-password password new-password password123 confirm-password password123",
"configuring": true,
"pending_config": false,
"restart_required": "FALSE"
},
"info": [
{
"level": "error",
"code": "E_NO_MATCH",
"message": "No matching command found."
}
]
}
}
Is their anyway to solve this? It seems API pushes the command 'admin-password' when it should be 'admin password'. Is it possible to use direct/cli to post the command directly to the cli? If so how would this be done?
Thanks
Best Answer
-
Jaime SonicWall Employee
Hello @Gee,
While we do have a fix coming as I mentioned previously, you have a great point that '/direct/cli' is an available option. Here's how you get that to work:
POST to /api/sonicos/direct/cli
Use the following headers:
Accept: text/plain
Content-Type: text/plain
Body (just in plaintext, with a single command per line as shown):
administration
admin password old-password YOUR_CURRENT_PASSWORD new-password YOUR_NEW_PASSWORD confirm-password YOUR_NEW_PASSWORD
end
When you post the command, you should get the following response:
% Processing request...
% Status returned processing command:
admin password old-password MY_OLD_PASSWORD new-password MY_NEW_PASSWORD confirm-password MY_NEW_PASSWORD
% Changes made.
Hope that helps.
0
Answers
Hi Gee,
I just tried it out and reproduced the error. I'll report this to our developers. To answer your question, you can use the CLI console or SSH to use the command directly.
Use the following once logged in:
config
administration
admin
<tab> for a list of commands.
I hope that helps.
Jaime
The fix is currently in development. Please look for this fix in an upcoming Maintenance Release.
Thanks!
@Jaime Thank you for the responses.
Sorry I was not clear enough - I understand how to do the commands manually through CLI.
The question I'm asking relates to using the direct-cli post method (/direct/cli) which can be found in the swagger UI for 6.5.4.6-79n firmware.
Thanks
-Ge
@Jaime Great response. I appreciate it. I will try this out later tonight. Thank you for answering!