Set Bash As Default Shell
I've used bash shell in all my Linuxes and in Mac OS X. I understand that tcsh is the default shell in FreeBSD. If I were to install bash, how would I make it my default shell?
ilkkachuYou can set fish as your default shell by running. Chsh -s `which fish` To do so for another user, just add the username at the end of the command, and use sudo. Then log out and back in. (To set it back to bash, you need to use Fish syntax of course, like this chsh -s (which bash)). Feb 2, 2007 - A. CSH is default shell under FreeBSD. First, make sure bash is installed. Type bash to see if you can execute bash: $ bash.
3 Answers
Changing one's login shell is covered by The FreeBSD Handbook, in the chapter called Shells. It also points to a chapter called Installing Applications: Packages and Ports that will tell you what you need to know for installing bash
(installing bash
from a FreeBSD package would automatically update /etc/shells
).
The steps involved, assuming an otherwise properly set up FreeBSD system, could probably be summarised into
Kusalananda♦KusalanandaHow To Check Default Shell In Linux
Yes
- install bash
- add it to
/etc/shells
- use chsh to set your new default shell.
Not the answer you're looking for? Browse other questions tagged bashshellfreebsddefaults or ask your own question.
I have csh
as my default shell, as shown by echo $SHELL
. I want to switch to bash
as my default shell. I tried the following approaches to no avail:
With
chsh
I get:With
ypchsh
I get:
I only have .chsrc
in my home directory and I cannot find any .profile
files in /etc
. How can I change my default shell to bash
?
How To Set Bash As Default Shell
2 Answers
Make sure you've got
bash
installed.Learn the location of
bash
:or
Below, I'll assume the location is
/bin/bash
.a) If you have administrative rights, just run as root:
(replacing
YOUR_USERNAME
with your user name).b) If you don't have adm. rights, you can still just run
bash --login
at login, by putting the below line at the end of your.cshrc
or.profile
(in your home directory) :
Contact your system administrator. He's set things up wrong. If you are your system administrator then you've set things up wrong.
The error message looks pretty straight forward. You don't have yppasswd
running on dcsun2. It should be.
But doing a quick google search comes up with this result which indicates that you'll get this error if yppasswd
is running on both the client and the server. In this case turn it off on the client.
If you're stuck with csh as your login shell, you can still make it invoke bash when you log in. Put the following commands in your ~/.login
(see also Changing the default shell without chsh or administrator priviledges):
Replace /usr/local/bin/bash
by the proper path if necessary. If everything works, remove sleep 2
(which puts a delay during which you can press Ctrl+C
to drop to a csh prompt, in case something goes wrong).