Page 1 of 1

[SOLVED] Cannot become root

Posted: 2011/10/26 07:00:00
by nipunreddevil
I just recently installed CentOs 6

A simple sudo or su doesn't work for me
Here is the exact trace

[nipun@dhcppc0 ~]$ sudo su
[sudo] password for nipun:
nipun is not in the sudoers file. This incident will be reported.
[nipun@dhcppc0 ~]$

I "nipun" am as such the only user.I tried running visudo which gave me the following trace
[nipun@dhcppc0 ~]$ visudo
visudo: /etc/sudoers: Permission denied
visudo: /etc/sudoers: Permission denied
[nipun@dhcppc0 ~]$

Re: Cannot become root

Posted: 2011/10/26 08:07:19
by TrevorH
Catch22. You have to be root to run visudo. You have to be in /etc/sudoers before you can sudo. To fix this you will need to know the root password and use

[code]
su -
visudo
<now add yourself to the sudoers list and save it>
[/code]

Re: Cannot become root

Posted: 2011/10/26 16:01:27
by nipunreddevil
Thanks :-)

[SOLVED] Cannot become root

Posted: 2011/10/27 11:04:40
by pschaff
Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature. I presume from your thanks that the thread can be marked [SOLVED] for posterity, so I am doing so on your behalf.

Re: [SOLVED] Cannot become root

Posted: 2012/06/23 13:43:28
by sputrniq
Tried this:

"permission denied"

Tried booting from livecd, mounting:

sudo mount /dev/sda1 /mnt

then

sudo visudo -f /etc/sudoer

didn't find file

booted into CentOS (6.2)

there's a

/usr/bin/sudo (with an X through it - need root access)

and a

/etc/sudoers.d (same thing as above - need root access)

I understand need root access to GET root access.

Thought I had it, set it up and was using it.

Seem to have lost it. Need it back.

One more detail:

user is: home-pc

Anyone?

Re: [SOLVED] Cannot become root

Posted: 2012/06/28 21:15:42
by pschaff
Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

After reading those links you should realize why you should not hijack threads as you have done. I see you have already started a [url=https://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=37931&forum=56]fresh topic[/url].