I've tried to change the shell for my root user. When I login now with my no-rights user and try to switch to my root users with su root -> password, the login fails because of this message:

Cannot execute whereis zsh: No such file or directory

The problem is, that I've entered the wrong path during the shell change to zsh. Any idea how I can fix this so I can log back in?

  • 1
    can you add more detail ? like what you used to change the shell ? – Vivek Kanadiya Mar 22 at 13:00

Ubuntu has sudo installed by default. If you still have sudo access you should be able to

sudo chsh -s /bin/bash root

This will reset root's shell to bash. Try this first.

If you don't have sudo access then you need to find a way to edit /etc/passwd. You might need to boot your system with special options giving you a root shell, OR you could plug your disk drive into another machine.

If you really need the root shell, there's instructions here: http://tipsonubuntu.com/2016/09/02/reset-forgotten-passwords-ubuntu-16-04/

At boot you either:

  • Select Advanced option for Ubuntu --> Ubuntu .... (Recovery Mode) --> root - Drop to root shell prompt
  • OR... press e while Ubuntu is selected and add the text init=/bin/bash to the linux params
  • Thanks, that saved my day! – Mr. Jo Mar 22 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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