心安处即吾乡!
分类: BSD
2014-04-17 20:18:33
A. CSH is default shell under FreeBSD. First, make sure bash is installed. Type bash to see if you can execute bash:
$ bash
If you get command not found error. Use pkg_add command to install bash
# pkg_add -r -v bash
Now to setup bash as shell type chsh command.
chsh -s /path/to/shell {user-name}
chsh changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account, the super user may change the login shell for any account. To setup bash default shell for user vivek, type command:
$ which bashOutput:
/usr/local/bin/bash
Now change shell:
$ chsh -s /usr/local/bin/bash vivekOutput:
Password
Provide your login password. Verify that shell is changed:
$ grep ^vivek /etc/passwd
You can also edit /etc/passwd file and change shell (you need to login as root user):
# vi /etc/passwdLast filed is shell
From
vivek:x:1000:1000:vivek,,,:/home/vivek:/bin/shTo
vivek:x:1000:1000:vivek,,,:/home/vivek:/usr/local/bin/bash
Save and close the file.