Wrong root shell in /etc/passwd

By accident, I changed shell of root account to /bin/sbin/nologin (should be /usr/sbin/nologin) in /etc/passwd. Now, I cannot even sudo from an admin account which was able to issue 'sudo' before. The error message is "johndoe not in the sudoers file."

I need a way to change /etc/passwd. Anyone can help?

1 Reply

@joelckchen --

The response by @bthompson at the end of this thread:

https://www.linode.com/community/questions/20269/root-password-reset-cannot-execute-binzsh-no-such-file-or-directory

discusses how to boot your Linode to rescue mode; mount your Linode's /dev/sda to the rescue mode system; and edit /etc/passwd to fix your mistake.

I'm pretty sure sshd(8) is not enabled in rescue mode (it's been awhile for me) so you will have to use lish/glish as your terminal.

-- sw

Reply

Please enter an answer
Tips:

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] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct