How to change root's shell back to bash?
Solution 1:
Assuming that you have not modified the path or created symlink, the default path to the bash
binary is /bin/bash
, not /usr/bin/bash
.
The error is occurring because you have set the root
's shell as /usr/bin/bash
in /etc/passwd
like:
root:x:0:0:root:/root:/usr/bin/bash
You need to change that to /bin/bash
:
sudo usermod -s /bin/bash root
or do:
sudo vipw
and make the modifications manually.
You can obviously choose any other shell of your choice, just make sure that the path is correct. A common place to look for shell paths is /etc/shells
file which contains the full paths to all the valid login shells on the system.