LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 07-12-2009, 09:15 AM   #1
AceCraft
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Rep: Reputation: 0
Logging as root / sudoer problem


Hi!

It has been a week since I've installed Fedora v.11 on my laptop and from the very beginning I couldn't log as a root (when I try to log in as root it prints: cannot identify user), execute 'sudo su' in terminal (couldn't figure why). Just recently I've discovered that the problem is with my /etc/sudoers file as there isn't any entry for normal users. Unfortunately I've absolutely no idea how I can change this file...
(it belongs to root, is -r-r--- and as I said - I cannot log in as root!)

Can anyone help me?
 
Old 07-12-2009, 09:49 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
AceCraft:

Is root user enabled in your system? there are some distros that defaults to no root.

Usually to create a sudo user you only need to use the user applet in the menu>admin>users. There create a new group named after your user name. Group=Username. Then make your username a member to that group. that's it. your should be able to sudo su and acquire root power.

goodluck.
 
Old 07-12-2009, 10:16 AM   #3
AceCraft
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Original Poster
Rep: Reputation: 0
I actually have a group named after my user account:
"id"
Code:
uid=500(michal) gid=500(michal) grupy=0(root),4(adm),5(tty),500(michal) kontekst=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
I've even added myself to 'root' and 'adm' in order to be in sudoers but it didn't help.
And how to enable root in system? There is 'root' user and 'root' group but I cannot log in.
 
Old 07-12-2009, 10:23 AM   #4
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
If you're able to add yourself to new groups, I am inferring that you can still sudo - have you tried `sudo passwd root`? Also, FYI, you never modify /etc/sudoers directly. There is a command `visudo` that opens an editor on it and then applies the changes, as otherwise they wouldn't be reflected immediately. Try sudoing that if you need to change sudo settings for this.
 
Old 07-12-2009, 10:39 AM   #5
raj77_in
LQ Newbie
 
Registered: Oct 2008
Posts: 26

Rep: Reputation: 15
From the output it looks like you have SELinux enabled, just that the SELinux policy is not blocking you.

You can enable sudo in the sudoers file with the following(if you want without password), is not commented:
%wheel ALL=(ALL) NOPASSWD: ALL
and then add your user to the wheel group.

If you desperately want root you can jump to init 1.
 
Old 07-12-2009, 01:55 PM   #6
AceCraft
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Yes, but I can't use visudo...
Code:
[michal@michal ~]$ sudo su
[sudo] password for michal: 
michal is not in the sudoers file.  This incident will be reported.
[michal@michal ~]$ visudo
visudo: /etc/sudoers: Permission denied
visudo: /etc/sudoers: Permission denied
neither can I login as root (how to enable it? Couldn't find this option in system->admin->users)
 
Old 07-12-2009, 02:08 PM   #7
scottro11
Member
 
Registered: Jun 2009
Location: NYC
Posts: 263

Rep: Reputation: 59
Fedora disables root by default. However, only from GDM.

Log in as normal user.

You should be able to do an su to root in any terminal.

It's not Ubuntu, and you don't have a sudo user enabled by default. I have a brief page on this as the question frequently arises on Fedora forums.

http://home.roadrunner.com/~computer...su/rhsudo.html

There are various other workarounds for the root login issues, mostly covered in the Fedora 11 release notes.
 
Old 07-12-2009, 02:15 PM   #8
AceCraft
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Thank you very much! now I know how to fix this
 
Old 07-12-2009, 02:18 PM   #9
scottro11
Member
 
Registered: Jun 2009
Location: NYC
Posts: 263

Rep: Reputation: 59
My pleasure. Believe me, it's a VERY frequent question on Fedora forums.
 
Old 07-12-2009, 03:28 PM   #10
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
OP, does that mean you were able to su to root? I thought you couldn't log in as him (/it)?
 
Old 07-13-2009, 08:43 AM   #11
AceCraft
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Actually I haven't tried to 'su root' before so yes - I was able to, sorry for misunderstanding :P
 
  


Reply

Tags
root login



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
problem logging into root account pcdsi Linux - Newbie 17 05-15-2009 04:02 PM
Add user to sudoer list but cannot use root commands vitalstrike82 Slackware 3 12-31-2008 07:27 AM
root not a sudoer??? LinuxNewbie999 Fedora 8 03-03-2008 03:38 PM
Is it possible to view root password if you are a sudoer? depam Linux - Security 15 05-08-2007 11:07 PM
problem logging in as root apant Linux - Newbie 3 07-03-2005 10:06 AM

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

All times are GMT -5. The time now is 09:46 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
Open Source Consulting | Domain Registration