[SOLVED] Cannot become root

Issues related to applications and software problems

[SOLVED] Cannot become root

Postby 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 ~]$
nipunreddevil
 
Posts: 4
Joined: 2011/10/26 06:54:38

Re: Cannot become root

Postby 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: Select all
su -
visudo
<now add yourself to the sudoers list and save it>
User avatar
TrevorH
Forum Moderator
 
Posts: 9147
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot become root

Postby nipunreddevil » 2011/10/26 16:01:27

Thanks :-)
nipunreddevil
 
Posts: 4
Joined: 2011/10/26 06:54:38

[SOLVED] Cannot become root

Postby 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.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: [SOLVED] Cannot become root

Postby 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?
sputrniq
 
Posts: 3
Joined: 2012/06/23 13:19:02

Re: [SOLVED] Cannot become root

Postby 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 fresh topic.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America


Return to CentOS 6 - Software Support

Who is online

Users browsing this forum: No registered users and 7 guests