I’ve inherited a self-hosted Tyk box to which everyone has, it seems, forgotten the access details for. I can access the VM itself (or, rather, I can access a clone).
While the original box is functioning (though inaccessible in terms of administration), I’m hoping I can clone it and access the clone to examine its configuration. Since I’ll have SSH access to the cloned VM, is there a way to reset the admin login details via the shell?
So, if anybody comes to this hoping for a similar answer - using a combination of the mongo shell, curl and reading the admin_secret from tyk_analytics.conf, yes you absolutely can.
With the admin_secret value as an admin-auth header, send a GET request to /admin/users/[the Mongo ID of a user you want to reset the password for]. Copy the output, PUT it to the same URL with a field named “password” added, with the value of your choice. This should update the password for that user.