# Login incorrect error after changing shell



## dbbolton (May 30, 2012)

I've installed FreeBSD 9 in a VM. I have one user account aside from root. I installed the zsh package and then set root's and my shell using chsh to /usr/local/bin/zsh, which was a valid entry in /etc/shells. After rebooting, I cannot log in. I know what the passwords are, and they are not incorrect. I used the recommended partition scheme including a boot, root, and swap partition; /usr is not separate or unmounted.

I have also tried booting into single user mode, running /bin/sh, mounting the filesystem, and resetting the password, but this did not work either.


----------



## Anonymous (May 30, 2012)

Can you boot into single user mode and reset the passwords?


----------



## dbbolton (May 30, 2012)

mharvey87 said:
			
		

> Can you boot into single user mode and reset the passwords?


Yes. When I run *whoami*, the result is 0. *passwd root* results in 
	
	



```
no such user
```

I also tried editing master.password. I erased the password hash for root and reset the shell to /bin/sh. When I try to log in as root, it still prompts for a password, I hit enter, and I still get the login incorrect message.


----------



## kpa (May 30, 2012)

Use vipw(8) for editing /etc/master.passwd, FreeBSD uses external db(3) style databases for user account files that need to created from the master file using proper utilities. The default shell for root is /bin/csh, don't change that to anything else.


----------



## dbbolton (May 30, 2012)

kpa said:
			
		

> Use vipw(8) for editing /etc/master.passwd, FreeBSD uses external db(3) style databases for user account files that need to created from the master file using proper utilities. The default shell for root is /bin/csh, don't change that to anything else.



After again booting into single-user mode and running *vipw*, I see that my changes made to the file using regular vi had stuck. I edited root's shell to csh, and rebooted. After this I was able to log in as root and reset the password.

However, I still don't understand why my regular user cannot log in with zsh.


----------



## Anonymous (May 30, 2012)

First of all, you shouldn't change your original post so much after you get responses to it. It makes the rest of the thread appear out of order, making less sense to anyone reading it, and therefore of less help to future people having the same problem.

After entering your username and password what is the exact wording of the error message you're getting? Is it just 
	
	



```
Login incorrect
```
 and then goes back to 
	
	



```
login:
```
 on the next line?


----------



## dbbolton (May 30, 2012)

Yes. It seems that the issue was how I used chsh. The first time, I ran it with no arguments, which spawned an editor where I entered the chagne manually (which led to the error). After resetting my shell to /bin/csh, I was able to log in. Then I ran `$ chsh -s /usr/local/bin/zsh`, and that worked.

In response to my inclusion of additional information in the OP, I wanted anyone who finds this thread (whether member or not) to be able to get a quick overview of the whole issue in the first post, as opposed to reading the entire thread, since sometimes threads can get quite lengthy. If your suggestion is an enforceable community guideline, I will be happy to follow it.


----------

