10

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?

12

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

| 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
  • 1
    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
  • 8
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.