This question was written in 2014, back when Cygwin still created an etc/passwd
file by default.
In more recent versions of Cygwin, no etc/passwd
file is created by default, and Cygwin has recommended against using it (presumably because Cygwin now reads directly from Windows account databases), instead recommending users to edit /etc/nsswitch.conf
, as P Daddy said in his answer.
However, editing /etc/nsswitch.conf
didn't help me, so I decided to create an etc/passwd
file after all, and that indeed solved my problem, letting me set zsh
as my default shell in Cygwin.
To do what I did, simply enter the command
mkpasswd -c | sed -e 'sX/bashX/zshX' | tee -a /etc/passwd
More details can be found in the following answer, which is where I got the command:
https://superuser.com/a/891728/1036875