WebUI password reset via SSH

I have a device whose password was lost, but I still have ssh access. What is the procedure to change the webUI password via SSH? It doesn't seem to be the same password as the underlying linux has configured.

I'm using a GL-A1300

Thank you.

As long as you are using firmware 4.x, the root and Web UI password are the same.
So using passwd will work.

Yes, you are correct. Thanks!