0

I did a stupid mistake on my Ubuntu virtual server (Amazon). I was messing around with /etc/passwd & /etc/group files and i am about to lock my self out of the server for good. I have a copy of the original passwd+group files but i cannot copy them back because every time i try to sudo i get :

sudo: unknown uid 1000: who are you?

I am still logged in. Is there anything i can try? I am afraid that after i log out there is no way to bring it back.

Thanks in advance.

1 Answer 1

0

Unless you know the root password you won't be able to get root access to fix the /etc/passwd and /etc/group files. What you could do is:

  1. Stop the instance
  2. Create a new instance with the same AMI id
  3. Disconnect the volume from the first instance and connect it to the new instance
  4. Mount the volume and fix the config files
  5. Umount and disconnect the original instance's volume
  6. Connect the volume to the original instance

A more specific guide can be found at http://amazonserver.blogspot.nl/2013/01/recover-broken-amazon-ec2-instance.html

2
  • 1
    Will try this first thing tommorow and post back the results. Thanks a million!
    – ktsangop
    Apr 9, 2014 at 13:47
  • I worked as a charm! Thank you again! Sorry i cannot upvote your answer also!
    – ktsangop
    Apr 10, 2014 at 9:29

You must log in to answer this question.

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