1

by ignorance and error I renamed the user_name of the directory /home/, called frank_account (home/frank_account) to sixven(/home/sixven) (using gksudo nautilus). Restarting Ubuntu, I get 3 users: frank_account, sixven and guest. However, I can not access to any account with password, only the guest_account and is very limited. entering by tty (Ctrl+Alt+F1), I can log in with the user and pass sixven but I can not do sudo as it tells me sixven not in sudoers. And will not let me edit the etc/sudoers file. How I can fix this problem?

3
  • have you tried rebooting in single user mode and change things back from there?
    – Anthon
    Mar 12, 2014 at 19:38
  • @Anthon How i do that? I don't know how to do it. Mar 12, 2014 at 19:40
  • I am going to write up the answer with some screenshots, please bare with me.
    – Anthon
    Mar 12, 2014 at 19:42

2 Answers 2

7

You should restart your machine and replace init with bash:

  1. Reboot the computer and hold Shift, so that the grub menu appears:

    enter image description here

  2. Highlight the second entry and press e

    enter image description here

  3. Use to go to the line stating with linux, then use to go to ro and change it in rw, remove everything after that with init=/bin/bash

    enter image description here

  4. Following the instructions at the bottom press F10

After the message stop scrolling you should have a prompt:

root(none):/#

which should allow you to roll-back the changes.

Afterwards reboot, by entering

sync
sync
exit

and press reset

The changes to the grub menu are not saved.

4
  • And when i press enter. What Should i do ? Mar 12, 2014 at 20:00
  • 1
    When did you press Enter? Did you start before I made the changes?
    – Anthon
    Mar 12, 2014 at 20:05
  • This doesn't really put the user in Single user mode, it replaces Init with bash. Exit at the end causes a kernel panic and a hang, hence the OP question "And when I press enter, What do I do now ?"
    – X Tian
    Mar 13, 2014 at 1:18
  • @XTian, ou are right about the single user mode. I was documenting that process for single user mode (adding single at point 3), but changed my mind without updating the start of the answer.
    – Anthon
    Mar 13, 2014 at 5:16
1
  1. Download a live linux system (http://www.knoppix.org/, http://www.ubuntu.com, etc.)
  2. Burn ISO
  3. Start from CD-Rom
  4. Rename the home folder back to "frank_account"

You must log in to answer this question.

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