How to change from csh to bash as default shell

  1. Make sure you've got bash installed.

  2. Learn the location of bash:

    which bash
    

    or

    whereis bash
    

    Below, I'll assume the location is /bin/bash.

    a) If you have administrative rights, just run as root:

    usermod -s /bin/bash YOUR_USERNAME
    

    (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) :

    setenv SHELL /bin/bash
    exec /bin/bash --login
    

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

sleep 2
if (-x /usr/local/bin/bash) then
  exec /usr/local/bin/bash -l
endif

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

Tags:

Shell