High Sierra not recognizing username when entering credentials After a new hard drive replacement in my old iMac (late 2009) I have similar problem like the questioner who changed it to grant. My main question if I follow the direction given in the answer will it reset to old Operating system? Please help.

To be clear I will explain what happened.

I tried to change user name in preferences, clicked on the current user (advanced options), which was named 'user', which was also the administrator, and changed the name. This didn't end up changing the username. I then tried to create another administrator user.

I logged out. When I logged back in the only user available to log in with was 'user'. When I opened user preferences I see that 'user' is no longer an administrator.

I now have no way of accessing an administrator. When I try move files into the applications folder it asks for admin username and password. I've tried every combination of 'user' and 'new user name' and nothing works.
Assuming you have a system installed that is new enough to allow you to boot into Recovery mode (hold ⌘-R at startup, if not, use the disk as explained in the article), I think this may help you. Oops, forgot your question title. Look for Terminal in the Utilities menu after you get into Recovery mode. "resetpassword" still works, even in High Sierra.

Use OS X Recovery Disk Assistant to reset Your files and folder permissions