Why does my console access log out after logging in?

May 13, 2016 2.2k views
DigitalOcean Ubuntu

When I try logging in to the console after using a new root password, I’m logged out again immediately. Why does this happen?

I’m able to reset the password in the control panel, and can log in to reset it. Once it’s changed, I just get this loop where I briefly see the Ubuntu login header before being logged out:


1 Answer

The most likely explanation is that root’s .profile or .bashrc file contains or indirectly runs the command exit or logout. You can fix this by SSHing in to your droplet with a specific command and thus bypassing Bash so that you get a chance to repair the damage; e.g., ssh root@IP_ADDRESS_OF_YOUR_DROPLET vim .profile will connect to your droplet and open .profile directly without invoking Bash.

Have another answer? Share your knowledge.