Lost admin privileges on iMac It happened after changing admin name following migration to new Mac Air. I've tried various suggested fixes calling for Single User Mode, then mount-uw/ and rm /var/db/. AppleSetUp, also going to Disk Utility and following suggestion to mount, etc. Nothing works. Every time I run a command I get no such file or directory, which I can only assume is why these fixes aren't working. Two questions:
1.Is there another step to the usual fixes that I need to be taking to avoid &quot;no such file...&quot;?
2. If all else fails, if I were to back up the system from Time Machine (pre-problem causing event), will my old admin privileges (name, password) be restored and things will be as they were, say, two weeks ago?
(High Sierra 10.13.6 if that matters)
It’s going to be hard to offer blanket advice since if your hardware has failed, your backup is suspect, no amount of correct process will help. This would be a data recovery project which is very different than trying to recover from a lost password, admin database corruption.

Reinstalling the current OS from recovery should fix the machine enough to follow this guide to reset the password. https://support.apple.com/en-us/HT211672
If you know your backup is good, erase the Mac and then migrate back. https://support.apple.com/guide/mac-help/erase-and-reinstall-macos-mh27903/mac

If you ask a follow on question making notes which parts of the password reset process you chose and what step was the last you could complete, we might be able to offer a process change in case you missed a step or there’s an undocumented fix, but there are a ton of steps in the reset process, hard to guess where your case diverged from the expected path...