root password reset & Cannot execute /bin/zsh: No such file or directory

ssh login as root not working neither via terminal nor via lish.
terminal simply says:

debug1: Authentications that can continue: publickey,password
Permission denied, please try again.

Lish at least let´s me login, as it seems but gives me the following message + logs me out again:

Cannot execute /bin/zsh: No such file or directory
Ubuntu 18.04.4 LTS li1664-202 ttyS0
li1664-202 login:

i have no further idea what i could try. also a backup from an old, working version, did not help.

2 Replies

I can't be certain of a fix here, but I have some resources for you that might help you out. I did some digging around on that error, and came across the following:

How could I reach root after switching from bash to zsh?

The above suggests changing the directory in which zsh exists. It also gives some other suggestions which may be worth looking into.

Another page from Superuser that might help:

Unable to login as root or as user because zsh is missing

I hope this gets you pointed in the right direction!

Hey @tomw,

It looks like your shell got changed from bash to zsh (z shell), which you don't currently have installed.

Cannot execute /bin/zsh: No such file or directory

This will cause the issues with Lish and ssh that you're describing. Both posts that @rgerke provided note the /etc/passwd file where this is set. Since you're getting logged out of Lish almost as soon as you login, you'll need to fix this by booting into rescue mode, mounting your disk, and opening that file with a text editor.

mkdir -p /media/sda
mount -o barrier=0 /dev/sda /media/sda
nano /media/sda/etc/passwd

Change the root user's shell from /bin/zsh


…back to /bin/bash.


Save changes and boot normally again, and you should be all set. You could also apt install zsh -y after that if you want Z shell installed.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct