Restore config minus password

Lost my admin password. Factory reset of a working mt300n alows me the enter a known admin password. Uploading my .tar backup restores functions BUT also restores the lost admin password. If I extract the .tar backup are there files I can delete or alter to keep the new admin password from being overwritten my the old admin password?

I am not totally sure but I would try this:

  1. Reset the router and set a known admin password
  2. SSH into router
  3. Do cat /etc/shadow
  4. Copy the content of this file to /etc/shadow inside the backup tar.gz
  5. Upload backup and restore

Now the known password should be the active one.

Thanks! I’ll try, then post the outcome.

Maybe you could even just delete the /etc/shadow from the backup, so you don’t need step 2 to 5. But not sure.

I’ve had no success with /etc/shadow being updated or deleted from the .tar restoration file. My new password is never retained. There’s another tab in Luci’s restore area where files can be excluded from import. The /etc/shadow exclusion seems to be ignored. Shouldn’t the hash representing the root password depend on an additional file (or some other value) for comparison?