Help - Search - Members - Calendar
Full Version: recovering /etc/passwd
Linuxhelp > Support > Technical Support
fatfingers
Hello everyone. First post here.

Let me start by saying that I am dumb. No need to point that out. Let me tell you what I did that was dumb.

I edited /etc/passwd on my mail server to include the following entry:

root:x:0:0:root:/root:/bin/bash/nologin

And now I cannot su to root. I get the following error:

[redacted@mail bin]$ su -
Password:
su: /bin/bash/nologin: Not a directory

Which makes sense.

Can anyone help me find a way to edit that file to correct that entry?

I've tried a couple things, but

su root --shell=/bin/sh

and

su -p -c vim /etc/passwd

don't work. I get the same error.

Am I totally boned here?

TIA for any pointers.
michaelk
Boot using a rescue CD or live CD, mount your / partition and edit the file.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.