Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
This answer on StackOverflow should help:…;. – boot13 May 20 '13 at 9:38
up vote 7 down vote accepted

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

share|improve this answer
Could you tell me how can I edit /etc/passwd file? I'm not familiar with cygwin commands – user67275 May 21 '13 at 8:08
I believe you would type nano /etc/passwd (you must run Cygwin as an administrator) and you would edit it from the command line. Then you press CTRL + X, then Y and finally the enter key to save it. – user202670 May 21 '13 at 10:29
I had to mkpasswd > /etc/passwd and then edit the line beginning with my firstname to match the desired cygwin username. It was my firstname because on Windows 10, I used a microsoft account as my windows login. – stevesliva Oct 14 '15 at 5:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .