2

Mysteriously, on our public SSH server, root user is now showing up as qroot. All the files owned by root are now owned by qroot.

id qroot shows qroot is UID 0

/etc/passwd file is owned by qroot

/etc/shadow is readable only by qroot

su - says su: user root does not exist

su qroot says password is wrong (probably because shadow file mismatches)

What can I do to recover root user?

Fedora 14, plain /etc/passwd file based auth.

5
  • 1
    You should also mention in your question what getent passwd root tells you. Commented Feb 6, 2018 at 20:03
  • 1
    @JdeBP I get no response for getent passwd root Just blank prompt... Commented Feb 6, 2018 at 20:38
  • @GAD3R Yes, I stumbled on that link upon Googling already. Couldnt get any useful remedies from it.. Commented Feb 6, 2018 at 20:42
  • 1
    Can you login as qroot using root's password? Commented Feb 6, 2018 at 23:42
  • 2
    is sudo installed? and configured to allow you to get a shell or run sudo vipw or similar? if so, then do that. Similarly, if you have an ~root/.ssh/authorized_keys set up to allow password-less root access you can ssh qroot@hostname and edit /etc/passwd. Otherwise, your best bet option would be to reboot to a rescue CD/USB-stick, mount the rootfs RW, and edit the /etc/passwd file to change qroot back to root. Commented Feb 7, 2018 at 1:10

1 Answer 1

2

Use the following command:

sudo -u \#0 vi /etc/passwd 

Then change the user name back to root. For the explanation please visit: https://aslamlatheef.blogspot.com/2015/09/why-cant-i-sudo-unknown-user-root.html

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.