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
chshI get:chsh: can only change local entries; use ypchsh instead.
-
With
ypchshI get:ypchsh: yppasswdd not running on NIS master host ("dcsun2").
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?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
-
Make sure you’ve got
bashinstalled. -
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_USERNAMEwith your user name).b) If you don’t have adm. rights, you can still just run
bash --loginat login, by putting the below line at the end of your.cshrcor.profile(in your home directory) :setenv SHELL /bin/bash exec /bin/bash --login
Method 2
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).
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0