2

Really need help here,

I made some mess into my /etc/passwd file, hoping that I can remove the user's password by removing its entry.

Upon saving it says cannot find name for user ID 1000. Now I can't do sudo or su - to access my superuser account because it always says Cannot determine your user name, I'm trying to edit the /etc/passwd again but unfortunately I don't have root access...

I'm stuck with an unknown user, and unfortunately I don't have any backup yet for the server.

Is this possible to be resolved without doing re-installation?

Any solution to fix this?

I badly needed this to be fixed..😭

8
  • Can you log in as root through TTY? Can you mount the drive in a different computer and edit it there?
    – Paul
    Nov 25, 2016 at 2:18
  • I tried logging in using root and my account password for Digital Ocean. but it says Login Incorrect
    – Renesansz
    Nov 25, 2016 at 2:21
  • Does Digital Ocean have a virtual terminal/TTY, emergency login, etc? That is where you would log in using root.
    – Paul
    Nov 25, 2016 at 2:22
  • yes, that's what I did. Access >> Launch Console
    – Renesansz
    Nov 25, 2016 at 2:24
  • I have never used Digital Ocean. Perhaps you can save the image, move the image to some sort of file bucket, then grab the files you need and stick them in a new build?
    – Paul
    Nov 25, 2016 at 2:26

1 Answer 1

4

Boot the system off of a live CD, mount your root filesystem, fix whatever you did to the file, then reboot.

And going forward, never edit that file directly. Instead, use the vipw command, which will prevent saving syntax errors most of the time.

2
  • I tried to do Mount Recovery Kernel but it says that my current plan doesn't allow me to do so... By the way I'm on Digital Ocean
    – Renesansz
    Nov 25, 2016 at 2:26
  • 2
    Talk with DO support then.
    – EEAA
    Nov 25, 2016 at 2:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .