LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-31-2011, 08:41 AM   #1
r2g2btru
LQ Newbie
 
Registered: Jan 2011
Distribution: Fedora 14
Posts: 26

Rep: Reputation: 0
Sudoers will not work


I have tried several things to attempt to fix my sudoers file however it is still coming up with errors. The error says
sudu: can't open /etc/sudoers: permission denied
sudo: no valid sudoers sources found, quitting

my permissions for /etc/sudoers are -r--r-----
my permissions for /etc are drw-r--r--
my permissions for /usr/bin/sudo are -rwsr-xr-x

the sudoers configuration file is set to the default as I have ran a dpkg on it, have also uninstalled and reinstalled it, and went over the configuration file ensuring it looked like the defaults I had seen online. Could somebody please help me get this fixed I have been trying everything to get this to work, and have used vast amounts of google research but to no avail. Thank you.

By the way the pertinent information from my uname -a is 2.6.35-28-generic-pae #50-Ubuntu SMP i686 GNU/Linux

Last edited by r2g2btru; 05-31-2011 at 08:45 AM.
 
Old 05-31-2011, 10:04 AM   #2
SkyEye
Member
 
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora (workstations), CentOS (servers), Arch, Mint, Ubuntu, and a few more.
Posts: 441

Rep: Reputation: 40
If your user account is already having sudo privileges (default case in Ubuntu), then run

$ sudo visudo

or,

$ sudo su -
# visudo
 
Old 05-31-2011, 11:26 AM   #3
r2g2btru
LQ Newbie
 
Registered: Jan 2011
Distribution: Fedora 14
Posts: 26

Original Poster
Rep: Reputation: 0
Yeah sudo won't even work from root. It has the default configuration, and I have tried it from a user that I added to the sudo group, and I still get the same error. I can edit the configuration file using visudo from root though. I am attaching a copy of my configuration file.
Attached Thumbnails
Click image for larger version

Name:	sudoconfig.JPG
Views:	374
Size:	40.7 KB
ID:	7184  

Last edited by r2g2btru; 05-31-2011 at 11:35 AM.
 
Old 05-31-2011, 12:21 PM   #4
SkyEye
Member
 
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora (workstations), CentOS (servers), Arch, Mint, Ubuntu, and a few more.
Posts: 441

Rep: Reputation: 40
Try adding your user after the root entry.
Eg:
root ALL=(ALL) ALL
r2g2btru ALL=(ALL) ALL

It's not the ideal setup, but its probably the one you want if you just want basic sudo setup.
 
Old 05-31-2011, 01:53 PM   #5
r2g2btru
LQ Newbie
 
Registered: Jan 2011
Distribution: Fedora 14
Posts: 26

Original Poster
Rep: Reputation: 0
I tried adding the user manually like that but it still doesn't work, remember it doesn't even work with root, the issue is whatever is causing this error code "sudu: can't open /etc/sudoers: permission denied
sudo: no valid sudoers sources found, quitting" I tried to check /var/log/messages and /var/log/secure to figure out what is causing this error but to no avail, is there a log specific to sudo, or is there a way to make sudo log is errors in a specific file? Does anybody know how to fix this issue, its been causing me headaches, it should be simple but for some reason everything I try fails.
 
Old 05-31-2011, 07:10 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Are you sure that your /etc directory's permissions are 0644? My /etc directory is 0755 (drwxr-xr-x) - when I set a directory to 0644 and try to list the files I get the same permission denied error you described.
 
Old 05-31-2011, 07:28 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Without x permission, the directory is not searchable.
 
1 members found this post helpful.
Old 05-31-2011, 09:14 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
r2g2btru
Did sudo ever work?
fedora dose NOT set it by default nor uses it by default
Quote:
Yeah sudo won't even work from root
so you used the not recomended fedora hack to allow root to loggin into the GUI ( gnome/KDE)
if so that hack can have unknown bad consequences , like things NOT WORKING .

or

sudo dose not work from the terminal after su -
but if this -- why???

to edit that file
run it as root
Code:
su -
--- your root password when asked ---
vi /etc/sudoers

Last edited by John VV; 05-31-2011 at 09:16 PM.
 
1 members found this post helpful.
Old 05-31-2011, 11:45 PM   #9
r2g2btru
LQ Newbie
 
Registered: Jan 2011
Distribution: Fedora 14
Posts: 26

Original Poster
Rep: Reputation: 0
Thank you so much that resolved my issue. I figured it was something that simple, I just couldn't figure it out, I tried all the more difficult steps first like dpkg, and reconfiguring, and so on. Thank you for your assistance. The other guy that was working on this server had switched these permissions in his attempt to get ftp working, which he failed at, in the end I got sftp and ssh working and have been trying to get sudo to work for a week. Thank you for your assistance.
 
  


Reply



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
[SOLVED] sudoers hurryi Linux - Newbie 10 10-17-2010 03:27 PM
Why does "joe ALL=NOPASSWD: ALL" in sudoers not work? lumix Linux - Newbie 3 06-19-2008 12:04 PM
Adding command privilege to /etc/sudoers doesn't work for some programs CJS Linux - General 9 05-13-2008 11:08 AM
grrrrrrrrrrrrrrrrrrrr sudoers wont work dave`2005 Linux - Newbie 4 03-12-2006 09:00 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:53 PM.

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