# Unable to change shell.



## caesius (Jun 28, 2011)

Hi. Recently I installed ksh93 and changed this to my default shell.

Now I've installed zsh and would like to make this my default.


```
> chsh -s /usr/local/bin/zsh
chsh: /usr/local/bin/ksh93: current shell non-standard
```

So I manually edited /etc/passwd as root. No change after reboot!

What the hangs going on here?

EDIT: Googling the error return ziltch


----------



## danger@ (Jun 28, 2011)

To edit passwd files, you need to use the vipw(8) utility. Also make sure your shell is listed in /etc/shells.


----------



## dclau (Jun 28, 2011)

First
[CMD=""]su[/CMD]
to become root, then
[CMD="chsh"]-s /usr/local/bin/zsh your_user[/CMD]
I presume /usr/local/bin/zsh is already listed in /etc/shells, as danger@ stated.


----------



## DutchDaemon (Jun 28, 2011)

If you *really* are brave and knowledgeable enough to edit your password file manually, at least edit /etc/master.passwd and run [cmd=]pwd_mkdb -p /etc/master.passwd[/cmd] to update /etc/passwd. Better still: use the proper tools, as mentioned above. Never edit /etc/passwd.


----------



## caesius (Jun 28, 2011)

Thanks. 

It's worth pointing out, the handbook's instructions (where I looked in the first place) still involve chsh(1).

http://www.freebsd.org/doc/handbook/shells.html



> The easiest way to change your shell is to use the chsh command. Running chsh will place you into the editor that is in your EDITOR environment variable; if it is not set, you will be placed in vi. Change the â€œShell:â€ line accordingly.
> 
> You can also give chsh the -s option; this will set your shell for you, without requiring you to enter an editor. For example, if you wanted to change your shell to bash, the following should do the trick:
> 
> % chsh -s /usr/local/bin/bash



Just to confirm: the handbook is incorrect?


----------



## DutchDaemon (Jun 29, 2011)

No, chsh(1) is just fine:

As a user:

```
$ chsh -s /usr/local/bin/bash                                                                                            
Password: 
chsh: user information updated
```
or as root:

```
# chsh -s /usr/local/bin/bash someuser                                                                                                        
chsh: user information updated
```

Of course, /usr/local/bin/bash must exist, and it must be listed in /etc/shells. That goes for zsh, mksh, or any other shell as well.


----------

