How to change user name on Cygwin

When I first installed and ran Cygwin, my username and PC name appeared at the beginning of the prompt, like

Johm@John-PC ~

The problem is, there was a typo in the account name when I first installed Windows 7 and it still remains in Cygwin.

I changed the Windows account name, changed the corresponding folder name and corrected the relevant registry (Local Machine->Microsoft->Windows NT->Current Version->profile list). Then I deleted Cygwin, including its registries, re-downloaded it, and installed it again.

But the old wrong user name still remains. How can I correct this?


Try editing the /etc/passwd file, the username can be changed in the first field. Avoid using spaces in the name