Set Bash As Default Shell

Posted on
  1. How To Check Default Shell In Linux
  2. How To 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?

ilkkachu

You 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.

64.8k10 gold badges108 silver badges188 bronze badges
Steve WrightSteve Wright

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

KusalanandaKusalananda

How To Check Default Shell In Linux

153k18 gold badges303 silver badges487 bronze badges

Yes

  • install bash
  • add it to /etc/shells
  • use chsh to set your new default shell.
ctrl-alt-delorctrl-alt-delor
13.6k5 gold badges29 silver badges64 bronze badges
Vladimir BotkaVladimir Botka

Not the answer you're looking for? Browse other questions tagged bashshellfreebsddefaults or ask your own question.

Linux set bash as default shell

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:

  1. With chsh I get:

  2. 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?

Kusalananda
153k18 gold badges303 silver badges487 bronze badges
SumodSumod

How To Set Bash As Default Shell

2 Answers

  1. Make sure you've got bash installed.

  2. 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) :

rozcietrzewiaczrozcietrzewiacz
30.1k4 gold badges77 silver badges93 bronze badges

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).

Community
bahamatbahamatShell
25.7k1 gold badge54 silver badges91 bronze badges

Not the answer you're looking for? Browse other questions tagged shell or ask your own question.