[SOLVED] Cannot become root

Issues related to applications and software problems
Post Reply
nipunreddevil
Posts: 4
Joined: 2011/10/26 06:54:38
Contact:

[SOLVED] Cannot become root

Post by nipunreddevil » 2011/10/26 07:00:00

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 ~]$

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot become root

Post by TrevorH » 2011/10/26 08:07:19

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]

nipunreddevil
Posts: 4
Joined: 2011/10/26 06:54:38
Contact:

Re: Cannot become root

Post by nipunreddevil » 2011/10/26 16:01:27

Thanks :-)

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] Cannot become root

Post by pschaff » 2011/10/27 11:04:40

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.

sputrniq
Posts: 3
Joined: 2012/06/23 13:19:02

Re: [SOLVED] Cannot become root

Post by sputrniq » 2012/06/23 13:43:28

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?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: [SOLVED] Cannot become root

Post by pschaff » 2012/06/28 21:15:42

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].

Post Reply