Linux – change default shell from zsh to bash

bashredhat-enterprise-linuxshellzsh

I'm trying to change my default shell in RHEL5 from zsh to bash.
I tried to the methods mentioned in this thead. By typing sudo /usr/bin/chsh -s /bin/bash, the system says sudo: /usr/bin/chsh: command not found. But the /usr/bin/chsh is there. Another way I found is to edit /etc/passwd file with my usrid, but it forbids me from editing it. Any suggestions?

Best Answer

Make sure /usr/bin/chsh has execute permissions by running sudo chmod a+x /usr/bin/chsh.


You should be able to run chsh using your own account. Otherwise you'd be setting root's shell. Try the following:

chsh -s $( which bash )
Related Question