## Change a user's default shell ##

[Author](authors.html): _name_ _[[contact]]_ _[[BSD_flavour]]_

[Reviewer](technical_reviewers.html): _name_ _[[contact]]_ _[[BSD_flavour]]_

[Reviewer](technical_reviewers.html): _name_ _[[contact]]_ _[[BSD_flavour]]_

----



### Concept ###

Know the default shells for both user accounts and
the superuser account for each BSD. In addition, know
how to change the default shell for each BSD operating system.

### Introduction ###

BSD systems historically use the standard C shell (/bin/csh) as root's login shell. OpenBSD uses /bin/ksh for both the root and regular user's shells.

TODO: should C shell be spelled out? Or called Csh? or csh?

If no shell is set (the 7th field in the passwd database is empty), then login and some other programs will default to standard /bin/sh.

Many system users use /sbin/nologin as the default shell. This utility will simply exit after outputting "This account is currently not available."
(Note: On FreeBSD, the nologin(8) utility is located at /usr/sbin/nologin.)

The standard tool for changing the user's login shell is chsh(1). (It is a link to chpass(1).) Running the chsh utility will start up
your preferred editor where the user can modify the selected shell (and other user database information).

The chsh program is setuid root, so it runs with root's privilege so it can modify the user databases. TODO: should this setuid be noted here?

TODO: should this cover EDITOR or VISUAL here? Or point to which topic page?

TODO: what systems don't default to vi for VISUAL or EDITOR??

The vipw tool can also be used to manually edit the master.passwd database and related user databases.
See section [[Protect_authentication_data]] for details.

TODO: show how to use chsh from command line without using editor. Do all BSDs support that?

TODO: show how to use pw (FreeBSD and DragonFly) to set shell and show how to use "usermod" (NetBSD and OpenBSD) for this. Or maybe not as is covered in another section.

TODO: point to section [[Create,_modify_and_remove_user_accounts]] and '[[Lock_a_user_account_or_reset_a_locked_user_account]]. Put these four sections next to each other in book

### Examples ###
 

### Practice Exercises ###


### More information ###

vipw(8); chpass(1), chfn(1), chsh(1), pw(8), user(8)


