This page was last modified: July 27 2006 16:21:06   
Too Cool for Internet Explorer

Changing the shell

This document describes how to permanently change the shell.

If you want another shell than the default one, you just run the chsh command with the username as an argument. Here's a quote from the man pages:

The chpass utility (aka chfn, chsh, ypchpass, ypchfn or ypchsh) allows editing of the user database information associated with user or, by default, the current user

When you type chsh, it opens the users database information in your default text editor. If your used to Vim, but has Vi as your default editor, your might save yourself some trouble by setting your default editor to Vim, before you proceed. Klik here to see how it's done

This will change the shell for user bill:

chsh bill [enter]

After entering the command, something like this will show up

1 #Changing user database information for bill.
2 Login: bill
3 Password: 80Hz4/b7uWCjs
4 Uid [#]: 1000
5 Gid [# or name]: 20
6 Change [month day year]:
7 Expire [month day year]:
8 Class:
9 Home directory: /home/bill
10 Shell: /bin/sh
11 Full Name: Bill Smith
12 Office Location:
13 Office Phone:
14 Home Phone:
15 Other information:

Line 10 in the above example holds the path to the current shell (/bin/sh). Just change it to the path of the preferred shell, for example /usr/local/bin/bash

Note that the change won't take effect before the next login.