It happened to me right now while testing that what can be the cause of the problem and sure it is because of a non-existent shell being set as root default shell.
I couldn't run any command with sudo, I wasn't able to run sudo -i, sudo -i /bin/bash or even sudo su -, because there is no /bin/bash/asd.
The only thing that I could do and it worked was running:
sudo -s /bin/dash
to get shell with root access, sudo -s /bin/bash should work too.
Then use nano to edit passwd file:
nano /etc/passwd
you should see a line look like this:
root:x:0:0:root:/root:/bin/bash/asd
change it to :
root:x:0:0:root:/root:/bin/bash
use Ctrl+O then pressing Enterto save the file.
Now use exit command to get out of dash shell which hasroot access.
You are done, however I suggest running:
sudo chsh root -s /bin/bash
to make sure permissions are correct.