LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-26-2011, 07:29 AM   #1
csj
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Rep: Reputation: Disabled
default root, user is not in the sudoers file


Hi guys,

My problem:
I have a newly installed ubuntu 11.10.
I have created only one user.
I would like to change some settings, which require root password, which is unknown for me and when 'su' is typed, the next message is received:
'csj is not in the sudoers file. This incident will be reported.'
What can I do now?
Thank you very much for your help in advance.
BR, CsJ
 
Old 10-26-2011, 07:43 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Use sudo to run the command, as your initial user, inputting your user password at the prompt.
 
Old 10-26-2011, 12:18 PM   #3
thezerodragon
Member
 
Registered: Apr 2009
Location: Paris, France
Distribution: Fedora 12 Constantine
Posts: 142

Rep: Reputation: 44
Quote:
Use sudo to run the command, as your initial user, inputting your user password at the prompt.
I don't know that he can do that if he's not in the sudoers file.

CSJ:

You definitely don't know the root password? You might be better off reinstalling, it's hard to recover if you're not already a sudoer.
 
Old 10-26-2011, 12:24 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853
Quote:
Originally Posted by thezerodragon View Post
it's hard to recover if you're not already a sudoer.
Not at all, just start from the Live-CD and edit the sudoers file on the disk.
 
1 members found this post helpful.
Old 10-26-2011, 04:21 PM   #5
csj
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andrewthomas View Post
Use sudo to run the command...
Trying to use sudo the answer is: 'csj is not in the sudoers file. This incident will be reported.'
 
Old 10-26-2011, 04:29 PM   #6
csj
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by thezerodragon View Post
You definitely don't know the root password?
I did not set up the root password, I was not asked about it...

Quote:
Originally Posted by thezerodragon View Post
You might be better off reinstalling, it's hard to recover if you're not already a sudoer.
Reinstall after two days... I would not loose too much, but I expected a more elegant solution.
 
Old 10-26-2011, 04:35 PM   #7
csj
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Arrow

Quote:
Originally Posted by TobiSGD View Post
Not at all, just start from the Live-CD and edit the sudoers file on the disk.
visudo: /etc/sudoers: Permission denied
vi sudoers Permission denied
chmod: changing permissions of `sudoers': Operation not permitted

Could you give me a more detailed explanation how I can do it?
 
Old 10-26-2011, 05:16 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,375

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Quote:
I did not set up the root password, I was not asked about it...
Ubuntu doesn't ask for a root password during installation but it does require a user. The primary user should be able to use the sudo command with the user password. If csj is the primary user you created during installation and you get that error, something is wrong. You need to mount your Ubuntu partition and go to that partition to edit with visudo.
 
Old 10-26-2011, 11:38 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853
Quote:
Originally Posted by csj View Post
visudo: /etc/sudoers: Permission denied
vi sudoers Permission denied
chmod: changing permissions of `sudoers': Operation not permitted

Could you give me a more detailed explanation how I can do it?
Start from your Ubuntu live disk. Assuming that your Ubuntu partition is /dev/sda1 you can mount the partition with
Code:
sudo mount /dev/sda1 /mnt
The add the line
Code:
csj    ALL=(ALL) ALL
to the sudoers file on the disk with
Code:
sudo nano /mnt/etc/sudoers
Of course you can use any other text editor instead of nano. Make sure that you don't have any typos in there. Reboot and you should be fine.
 
1 members found this post helpful.
Old 10-26-2011, 11:59 PM   #10
thezerodragon
Member
 
Registered: Apr 2009
Location: Paris, France
Distribution: Fedora 12 Constantine
Posts: 142

Rep: Reputation: 44
Quote:
Of course you can use any other text editor instead of nano
I learned to do this using echo as demonstrated here. It also shows how to set up the user as a no-password sudoer.

http://www.mjmwired.net/resources/mj...-f15.html#sudo
 
Old 10-29-2011, 06:22 AM   #11
csj
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks, guys, csj is again in the sudoers.

But... update manager requires root password. Why? What can I do with that? (I can upgrade the system from command line, but I can not use update manager.)
 
Old 10-29-2011, 08:09 AM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853
Try it with your password, that should work if you start it with sudo. You also can easily set a new password for root with
Code:
sudo passwd root

Last edited by TobiSGD; 10-29-2011 at 08:10 AM.
 
Old 10-29-2011, 08:37 AM   #13
csj
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Ok, it works, thanks a lot!
Now I have root access as well.

Last edited by csj; 10-29-2011 at 08:41 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'user' not in the sudoers file thomas2004ch Linux - Software 6 05-24-2011 11:20 AM
"USER is not in the sudoers file" - why doesn't my computer acknowledge me as root? Eutanasi Linux - Newbie 3 11-25-2010 02:12 PM
User not in the sudoers file ersek Linux - Newbie 10 06-09-2009 01:35 PM
Adding a user to the sudoers file? annihilan Slackware 5 11-13-2008 05:36 PM
how a user can be added to sudoers file. afaheem1988 Linux - Newbie 5 08-10-2008 08:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration