Setting admin password via SSH

I have several GL-MT300N-V2 routers I’m trying to configure in an automatic way. Connecting to their wifi and logging in via ssh is easy enough, but I’m unable to figure out how to set the admin password from the cli.

I’ve searched the configs for where the password is stored but didn’t find it, and tried to set it using the passwd command, which changed the ssh login password, but it the web interface password didn’t change with it. I’ve considered sending a POST request to http://192.168.8.1/cgi-bin/api/router/initpwd but I’d prefer to do everything over ssh if possible, at the moment this solution is my last resort.

Any ideas how to do this?

I can give you via private message. It is a little complicated and I don’t want to make this public.

alzhao sent me info via PM that worked to do this. If you’re doing the same thing I was, contact one of their staff for the details.

1 Like

What is the solution? Why don’t you want to make it public?
Can I ask for this hidden solution too?

Because that is not a normal use. There is no hidden solutions.

@Jake tell me his details scenario so I would like to help his case.

Can we make it public?

What is the solution?

I use a shell script to streamline the initial setup for multiple routers, which invokes ‘curl’ to POST to the ‘initpwd’ webAPI.

Check my original post from last year.

1 Like