Page 1 of 2

reset root password [Solved]

PostPosted: Sat Dec 21, 2013 13:46
by m.reza
Hello, everybody.
I installed virtualbox and used "usermod" to add my username to vboxusers. Now, I can't access root anymore. I tried "sudo su -" to change root password, but I'm not a sudoer. I also tried to use recovery mode, but it asks for root password too.
Help me reset the root password, please.
Thanks.

Re: reset root password

PostPosted: Sat Dec 21, 2013 14:48
by batvink
I quess you have to reset your root-password using a live-cd., described in our Wiki:
https://wiki.sabayon.org/index.php?title=HOWTO:_chroot_from_a_LiveCD

Read carefully, and Just follow step by step.
Once chrooted in the installed Environment, you got yourself a root-prompt.
Simply enter:
Code: Select all
passwd

to assign a new password for root.

Re: reset root password

PostPosted: Sat Dec 21, 2013 16:00
by m.reza
Thank you for the answer.
I followed the instructions in wiki. I didn't encounter any errors, but it doesn't still work. I get "permission denied" in terminal.

Re: reset root password

PostPosted: Sat Dec 21, 2013 17:08
by batvink
???
on the live-cd?

Re: reset root password

PostPosted: Sat Dec 21, 2013 17:29
by m.reza
No, I get "permission denied" in installed Sabayon. I used live-USB to do all those stuff. When I rebooted to my Sabayon, it was like before.

Anybody, please help. I can't update my Sabayon or install anything :cry:

Re: reset root password

PostPosted: Sun Dec 22, 2013 11:07
by batvink
you don't get a root-prompt after chrooting? (thus: chroot failed)
or "permission denied" when entering passwd....

Re: reset root password

PostPosted: Sun Dec 22, 2013 11:13
by m.reza
I did everything that wiki page said. Then I entered "passwd" and entered a password (which is supposed to be the new root pasword). Then I exit from "chrooted" and "umount" the partitions. Then I reboot and start my real Sabayon (which is installed on my hard disk. When I want to "su", I enter the password the I set in live session. But it returns "permission denied."

Re: reset root password

PostPosted: Sun Dec 22, 2013 11:27
by batvink
Ah, of course.
You said earlier that you don't have permission, because you're not a sudoer.
You chould chroot again, and within the chroot add yourself to the sudoers file.
Enter:
Code: Select all
visudo

and alter the file.
It should look like this:
http://pastebin.sabayon.org/pastie/15873

Re: reset root password

PostPosted: Sun Dec 22, 2013 11:48
by m.reza
Thank you. Now, I can at least update Sabayon and install sofwares. I added this line:
Code: Select all
<username> ALL=(ALL) ALL

I can now sudo.
Is there anyway to have the old root? 'Cause I can't still access it.

Re: reset root password

PostPosted: Sun Dec 22, 2013 11:53
by batvink
add yourself to the wheel group,
and add this line to the sudoers file:
Code: Select all
%wheel  ALL=ALL