Hi all,
I have a big dilemma on my hands, and am on my last straw trying to solve this. While typing too fast and wanting to change the shell for a given user to prevent SSH access, I ran the following command:
Code:
sudo chsh /sbin/nologin
Without specifying the user, it seemed as though it defaulted to making the root shell /sbin/nologin, not good!
I booted into recovery mode, and followed these steps:
mounted /dev/xvda /media/xvda
edited /etc/passwd to change root shell back to /bin/bash
Checked file again, shell set to bin bash
Added user "onestp" to sudoers list as a fallback
ran sudo usermod -s /bin/bash root and was no change, so shell was correct
changed root password to be sure
Exited & rebooted
Now when I SSH in as root I still have no acccess. When I SSH in as user onestp (with sudo ability) and run this command:
Code:
sudo su -s /bin/bash root
But when typing in password I still get the error that /sbin/nolong does not exists, so the shell is not changing for user root.
Any ideas on how I can recover access to my VPS as root user?
Thank you,
Simon