ssh root access denied after changing shell

  1. Always use vipw to edit /etc/passwd, and vipw -s to edit /etc/shadow.
  2. Check that the shells you're trying to use are listed in /etc/shells.
  3. Check that SElinux is not set to 'enforcing' in /etc/selinux/config. Change it to 'permissive' or 'disabled'. [requires reboot]
  4. When you want to try a new shell don't log out to test it. Start up an additional SSH session or tty, and leave the current one running in case you f*ck it up.
  5. Check your logs for errors relevant to the login process that might indicate what else is wrong.

If you still can't fix it on your own, then contact your hosting provider. They will either know how to fix it inside of 10 minutes, or you should find a better host.