Sudo unable to open /etc/sudoers

Whenever I try to do anything at all with sudo on my fresh x86-64 Arch install, it prints out this error:
sudo: unable to open /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
This is on a fresh Arch install from the core Image CD, packages initially installed from the CD and then upgraded with #pacman -Syu. I can edit sudoers just fine with visudo, and installing outdated versions of sudo produce the same error. File permissions on both /usr/bin/sudo and /etc/sudoers both look as they should be. Also, users and user groups don't seem to be an issue.
Found this related StackExchange thread and here are the outputs of strace and ltrace if anyone can interpret them: http://unix.stackexchange.com/questions … most-files
Ltrace:
# ltrace -u notthemessiah sudo true 2>&1 | egrep '(sudo|stat|set.*[ug].*id)'
bindtextdomain("sudo", "/usr/share/locale") = "/usr/share/locale"
textdomain("sudo") = "sudo"
strlen("sudo") = 4
memcpy(0x01c6f299, "sudo", 4) = 0x01c6f299
fopen("/etc/sudo.conf", "r") = 0
__xstat(1, "/usr/lib/sudoers.so", 0x7fff6b0913d0) = 0
dlopen("/usr/lib/sudoers.so", 257) = 0x01c6f630
dlsym(0x01c6f630, "sudoers_policy") = 0x7f33e2f96960
__xstat(1, "/usr/lib/sudoers.so", 0x7fff6b0913d0) = 0
dlopen("/usr/lib/sudoers.so", 257) = 0x01c6f630
dlsym(0x01c6f630, "sudoers_io") = 0x7f33e2f969c0
fputs("sudo", 0x7f33e35296e0sudo) = 1
fputs("unable to open /etc/sudoers", 0x7f33e35296e0unable to open /etc/sudoers) = 1
fputs("sudo", 0x7f33e35296e0sudo) = 1
fputs("no valid sudoers sources found, "..., 0x7f33e35296e0no valid sudoers sources found, quitting) = 1
fputs("sudo", 0x7f33e35296e0sudo) = 1
+++ exited (status 1) +++
Strace:
# strace -u notthemessiah sudo true 2>&1 | egrep '(sudo|set.*[ug].*id)'
execve("/usr/bin/sudo", ["sudo", "true"], [/* 22 vars */]) = 0
open("/etc/sudo.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib/sudoers.so", {st_mode=S_IFREG|0755, st_size=185352, ...}) = 0
open("/usr/lib/sudoers.so", O_RDONLY) = 3
stat("/usr/lib/sudoers.so", {st_mode=S_IFREG|0755, st_size=185352, ...}) = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/sudoers.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/sudoers.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/sudoers.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/sudoers.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/sudoers.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/sudoers.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
lstat("/etc/sudoers", {st_mode=S_IFREG|0440, st_size=2849, ...}) = 0
setresgid(4294967295, 0, 4294967295) = 0
setresuid(0, 1, 4294967295) = 0
open("/etc/sudoers", O_RDONLY) = -1 EACCES (Permission denied)
setresuid(4294967295, 0, 4294967295) = 0
write(2, "sudo", 4sudo) = 4
write(2, "unable to open /etc/sudoers", 27unable to open /etc/sudoers) = 27
setresuid(4294967295, 1, 4294967295) = 0
setresgid(4294967295, 0, 4294967295) = 0
setresuid(4294967295, 0, 4294967295) = 0
setresuid(1000, 0, 4294967295) = 0
setresgid(1000, 1000, 1000) = 0
write(2, "sudo", 4sudo) = 4
write(2, "no valid sudoers sources found, "..., 40no valid sudoers sources found, quitting) = 40
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/sudo.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "sudo", 4sudo) = 4

No, I used visudoers and everything relating to that correctly. It's just probably something that happened while installing the core packages from the install CD that caused problems. As of now, I just reinstalled Arch on a new partition (this was a fairly fresh install) and it seems to work just fine. I was willing to continue to test the issue, but resizing the partition seems to have corrupted it somehow.

Similar Messages

  • Sudo: unable to stat /etc/sudoers: No such file or directory sudo: no valid sudoers sources found, quitting

    I am trying to empty my trash but it wouldn't . so I ran this command sudo rm -rf ~/.Trash/* in the terminal
    I got an error message
    "sudo: unable to stat /etc/sudoers: No such file or directory
    sudo: no valid sudoers sources found, quitting"
    does anyone have a clue? thanks

    First, never use the shell (Terminal) to empty the Trash. It's dangerous and unnecessary, and it usually doesn't work.
    A necessary system file is missing. If you know how that happened, restore it from a backup. Otherwise, see below.
    If you don't already have a current backup, back up all data, then reinstall the OS.* You don't need to erase the startup volume, and you won't need the backup unless something goes wrong. If the system was upgraded from an older version of OS X, you may need the Apple ID and password you used.
    If you use FileVault 2, then before running the Installer you must launch Disk Utility and select the icon of the FileVault startup volume ("Macintosh HD," unless you gave it a different name.) It will be nested below another icon with the same name. Click the Unlock button in the toolbar and enter your login password when prompted. Then quit Disk Utility to be returned to the main Recovery screen.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    If you installed the Java runtime distributed by Apple and still need it, you'll have to reinstall it. The same goes for Xcode. All other data will be preserved.
    *The linked support article refers to OS X 10.10 ("Yosemite"), but the procedure is the same for OS X 10.7 ("Lion") and later.

  • When ever i use a "sudo" command, it returns "sudo: can't open /etc/sudoers: Permission denied".... HELP PLEASE

    While using terminal, any commands with sudo returns the statement seen in the heading... I have only a basic idea of whats happening, so please try and make the solutions simple.. much appreciated

    Are you being prompted for a password? Are you using the same password you sign in with? Try just entering sudo with:
    sudo su -
    It will ask you for a password and then give you a stern warning about acting as root, where you can really mess up your computer for good if you are not careful. If it won't change to the root account you have a permission problem or a credentials problem.

  • Remote rsync via sudo only works temporarily after touching or opening /etc/sudoers

    Hi,
    We are running an rsync backup of an OS X 10.9.1 Server from a Linux server via cron.  Root is not enabled on the OS X server and the password for the admin user is handled via keys ala: http://www.linuxproblem.org/art_9.html .  Rsync on the OS X server is version 3.0.6, plucked from Carbon Copy Cloner.
    The rsync command run from the Linux server is:
    rsync -aHXxsh --delete -e "ssh -t" --rsync-path="sudo /usr/local/bin/rsync -v" [email protected]:/Volumes/files/ /backup/files/
    Our issue is that this works fine only temporarily after having either opened or touched the sudoers file on the OS X server.  After a bit of time passes however (~10-15 minutes), we start seeing: "no tty present and no askpass program specified" responses and the rsync fails.  OS X Server log entries showing the error, the touch command that fixes it (sudo visudo fixes it as well), then the successful rsync are:
    1/28/14 8:13:06.493 AM sudo[5596]:   admin_user : no tty present and no askpass program specified ; TTY=unknown ; PWD=/Users/admin_user ; USER=root ; COMMAND=/usr/local/bin/rsync -v --server --sender -slHogDtpXrxe.is
    1/28/14 8:13:13.286 AM sudo[5598]:   admin_user : TTY=ttys000 ; PWD=/private/etc ; USER=root ; COMMAND=/usr/bin/touch ./sudoers
    1/28/14 8:13:15.360 AM sudo[5607]:   admin_user : TTY=unknown ; PWD=/Users/admin_user ; USER=root ; COMMAND=/usr/local/bin/rsync -v --server --sender -slHogDtpXrxe.is
    The OS X server is running Backblaze and Time Machine and the issue persists with both Backblaze paused and Time Machine turned off, and also after reboots.
    Does anyone have any ideas on a cause for this?  Or even how to better troubleshoot it?
    Thanks in advance and all best.

    Thank very much Linc.
    We have exempted the admin account from the password requirement for the rsync 3.0.6 command, which is from the depths of Carbon Copy Cloner and does support ACLs, xattrs, file-flags, etc.
    Understood the admin account could now overwrite suoders via rsync, but for our environment am willing to accept this until the approach is revised.
    I wasn't aware sudo cached authorization for all sessions of the same user (ie: once logged in via a terminal checking the sudoers file and the same user logging in again via the backup script), so that was very helpful for tracking down our issue, which is now resolved.
    Your work here is always informative!   All best and thanks again.

  • Sudo can't open /etc/sysinfo.conf mac os x lion

    I have been trying to get locate to work for ages now (well not really, only since I upgraded to lion).
    And I'm having no joy. I keep getting an su error when /usr/libexec/locate.updatedb is being called.
    Terminal just throws this cool error "su: Sorry".
    Console (syslog) shows this error
    (pam_acct_mgmt: error in service module)
    Which apparently means an error occured in a PAM module
    I decided to run dtrace opensnoop to find out what files were being opened and what was going wrong.
    Mind you that I am not versed in Dtrace, this is one of my first uses.
    This is what I get when I run "sudo /usr/libexec/locate.updatedb" whilst running "sudo opensnoop -x -n sudo -e":
    UID
    PID
    COMM
    FD
    ERR
    PATH
    0
    54853
    sudo
    -1
    2
    /etc/sysinfo.conf
    0
    54854
    sudo
    -1
    2
    /proc/self/fd
    0
    54858
    su
    -1
    2
    /etc/sysinfo.conf
    /etc/sysinfo.conf does not exist on my system.
    This might be the cullprit, but I'm not sure.
    I have been getting the very "helpfull" tip to just use mdfind.
    Not being able to use locate isn't the end of the world for me, it just bugs the **** out of me that it doesn't work anymore.
    I can't shake the feeling that I don't know what else is broken.

    I fixed the issue by doing a clean install of Lion.
    Now locate works as expected.
    Incidentally, when I installed Xcode on my upgraded version of Lion I had the same problem that many other people had which was that the installer window (the one with the progress bar) got stuck at 99% even though Xcode finished installing.
    I did not have this issue with the clean install Lion... hmm go figure.

  • 3 unable to open '/etc/udev/rules.d/':m error during booting

    After a recent upgrade to the kernel26-2.6.28.5-1-i686, I got the above error during booting in one of the laptop.
    My search did not give any positive solution for this till now. I read that now udev gets its rules from /lib/udev/rules.d.
    But still rules files in /etc/udev/rules.d and /lib/udev/rules.d are different. I know that any symllink work around will not work in this case, I tried but as  expected the error message appears again.
    So, I roll back to kernel26-2.6.28.4-1-i686 and everything back to normal.
    Any Idea to resolve this? (package is not broken as I use the same mirror for another PC and in that I am not getting any error)
    Last edited by kgas (2009-02-19 16:10:23)

    This issue got resolved on its own with the latest kernel (kernel26-2.6.28.6-1-i686) update. I will leave this topic for some more time to see others response...

  • [SOLVED] Unable to use SUDO: issues with /etc/sudoers

    I have reinstalled Arch_64 and I have run into some problems with SUDO.
    I get the following errors when I try to use sudo:
    sudo : unable to stat /etc/sudoers : Permission Denied
    sudo : no valid sudoers sources found, quitting
    sudo : unable to initialize policy plugin
    Here's what I have done with it so far:
    * I added USERNAME (myself) to the 'wheel' group
    * I uncommented %wheel ALL=(ALL) All using visudo
    As it was not working for me I also:
    * # chown -c root:root /etc/sudoers
    * # chmod -c 0440 /etc/sudoers
    * Since that too did not work, I recommented %wheel and added USERNAME ALL=(ALL) ALL just under the line root ALL=(ALL) ALL and repeated the above steps. The above problem persists.
    * I checked with visudo -c and it says "/etc/sudoers parsed ok".
    I have been through the WIKI and the forums but still unable to figure out whats going wrong.
    I will appreciate if the forum can guide me to solution and help me resolve this issue.
    Thanks.
    Last edited by fantab (2012-11-20 09:00:56)

    Had exactly the same problem with a new Arch_64 install a few months ago, which turned out to be a problem with permissions on / (which i changed with chmod) - can't remember the details, but it was this post that put me on to a solution:
    http://archlinuxarm.org/forum/viewtopic … =20#p19727

  • In the context of restoring a drive from a backup, i copied /etc/sudoers from my backup. Now it does not work due to the permissions not being correct (even though it was copied via sudo cp -rp)

    In the context of restoring a drive from a backup, i copied /etc/sudoers from my backup. Now it does not work due to the permissions not being correct (even though it was copied via sudo cp -rp)

    Most likely you have Office 2004 which are PPC-only applications and will not work in Lion. Upgrade to Office 2011. Other alternatives are:
    Apple's iWork suite (Pages, Numbers, and Keynote.)
    Open Office (Office 2007-like suite compatible with OS X.)
    NeoOffice (similar to Open Office.)
    LibreOffice (a new direction for the Open Office suite.)

  • I am unable to open Safari.  It was working yesterday before I installed the update.  The update seemed to be automtic when I restarted my computer.  I am running 10.9.5.  I don't want to lose my contacts, bookmarks etc if I have to delate the app.

    I am unable to open Safari.  It was working yesterday before I installed the update.  The update seemed to be automatic when I restarted my computer.  I am running 10.9.5.  I don't want to lose my contacts, bookmarks etc if I have to delete the app.  Any suggestions?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen. Click the Clear Display icon in the toolbar. Try to launch Safari. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Using sudo gives "/etc/sudoers is mode 0640, should be 0440" error...

    I tried to edit the sudoers file and must have done something wrong. Every time I try to use the sudo command I get the following two errors:
    sudo: /etc/sudoers is mode 0640, should be 0440
    and
    Segmentation fault
    I'm a new user. Any ideas on how I can get things fixed up again so that I can use sudo again?
    Thanks in advance.

    Solved the issue by running the *Disk Utility* and running the *Repair Permissions* command.

  • How do i fix this sudo: /opt/local/etc/sudoers is owned by uid 501, should be 0

    sudo is broken

    With the following commands from Single User mode:
    mount -uw /
    chown root /opt/local/etc/sudoers
    or from the DVD:
    chown root /Volumes/Macintosh\ HD/opt/local/etc/sudoers
    assuming Macintosh HD is the drive's name.
    (58851)

  • Error with command "sudo: /etc/sudoers is mode 0777, should be 0440 Segmentation fault"

    I don't know what to do... I installed XAMPP for Mac and then Joomla, I had some problems and I changed the permissions to some folders, so everything was working well, later I turned off my MacBook and when turned on some parts of Joomla was not working (http://localhost/administrator) neither MySQL Server (http://localhost/phpmyadmin), so I entered to a console and I tried to change the permissions again but when I try to be superuser I can't, the error that means is:
    sudo: /etc/sudoers is mode 0777, should be 0440 Segmentation fault
    Sorry, I don't speak english, I tried to explain my error the better i could.

    What is an SO disk? Do you mean your install disks? If so, don't use them. Run Disk Utility from your hard drive. The only time you should run Disk Utility from an install disk is when you need to repair the filesystem. When running Repair Permissions, it should be run from your hard drive so that the permissions it fixes correspond with your updated OS version.

  • Since installing OS X Mavericks I am unable to open Adobe CS5 software such as Photoshop CS5 etc

    Since installing OS X Mavericks I am unable to open Adobe CS5 software such as Photoshop CS5 etc

    Check out the Adobe / Mavericks support page >  OS Compatibility and FAQs for Mac OS Mavericks (v10.9)

  • Unable to open file in browser (Microsoft Word Web App, PDFs, etc) after updates

    We just updated with the recent updates, and now are unable to open any documents in the browser in IE. We are using version IE 11. This is not an issue in Firefox or Chrome. Does anyone have any fixes to this? This seems like some sort of compatability
    issue, but we are running our browser in compatability mode.
    Our temporary fix is just to have documents open in the client program, but this really isn't as convenient.

    etoile, can you check the ULS logs on the OWA server at C:\ProgramData\Microsoft\OfficeWebApps\Data\Logs\ULS\, reproduce your error, and see what is captured in the log?
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Unable to open files in InCopy6, etc.

    We have been using an InDesign/InCopy workflow for a little over a year. Until recently, we were using InDesign5 and InCopy 5.5, and we had no problems opening and working in the assignments. In the last month or two, some of our new freelancers purchased InCopy6, and it quickly became apparent that it was not compatible with files created in InDesign5. They were unable to open packages, or if a package could be opened it ultimately crashed and lost the changes.
    We have upgraded across the board: designers all have InDesign6, and editors/copy editors have InCopy6. However, this upgrade has not resolved the problems and, in fact, the problems seem to be increasing. Many of the files still cannot be opened (often, InCopy shuts down when trying to open a file and says "a serious error was detected"); this seems to be happening more with larger files. Also, some projects open but have pages missing from story/galley view.
    Our designers say that they are continuing to work and create assignment packages as before, and even our veteran editors and copy editors are having issues. Does anyone have insight into what may be happening and how we can resolve it? At this point, it's getting hard to rely on this workflow.

    Here's a follow up.
    I've isolated the issue to a corrupt .indd file. I can't explain how the file got corrupt, but I'm fairly sure this is the cause of my issues here.
    Here's what happened.
    We use a Dropbox workflow.
    I start by creating templates for what we call "program guides." I believe I originally created the template in question with InDesign CS5, but it may have been created with the pre-updated version of InDesign CS6. I don't remember. I then save the stories to a stories folder in the root folder of the document so a compliance officer can edit the content via InCopy CS6.
    When a client needs a Program Guide, I then open that template and re-save it into a client specific folder. I delete/unlink the stories and re-export new stories into a stories folder located next to the specific client's Program Guide. Program Managers then edit the marketing portion of the Program Guide content via InCopy CS6.
    The issue in this case - the Program Manager could not edit the document, nor could he see the "Galley" or "Story" tabs indicating that InCopy could not see any linked stories.
    - I tried re-saving the document, deleting and re-exporting the stories; same result
    - I tried exporting the document in .IDML so as to "clense" it and eliminate any corruption; same result
    - I tried eliminating elements from the document, one by one, to asertain if a corrupt element (image or text box) might be the culprit; same result
    - I finally created a new document, with new text frames and cut and paste the "text only" into the new document/text frames - this worked. When I exported the stories, InCopy was able to see and edit them.
    As I believe my original work flow was correct, I still regard this a "bug" in InDesign as the issue seems to have something to do with the way InDesign saves/re-saves an InDesign document.
    I do believe I have a tempory work-a-round that will allow me to continue using an InCopy workflow until Adobe updates the software.

Maybe you are looking for

  • How to set up rules/conditions on a drop down box to ensure its been filled if a value in a text box is selected.

    Hi, I am in midst of creating a form in infopath. I have a text box field in which the user will enter the number of issues he has. if the user has entered the number of issues he has, then he will need to select the type of issues from a multi selec

  • IMovie won't open, but can see in expose

    I am unable to open and use iMovie.  When I open it I can see the menu bar, but the project screen doesn't show up.  When I use three finger swipe to go into expose, I can see it in there.  When I click on it it goes off to the right, top corner of s

  • How to apply different styles to multiple spry collapsible panels?

    Hello every. I would really appreciate some help with this problem I am coming up against. I am creating a website which has multiple Spry collapsible panels in it. I applied the styles I wanted for the first Spry collapsible panel I did in the style

  • LDAP Query´s Slow on Virtual DC with W2K12 over Hyper-V W2K12 R2

    Hello, We have 2 Virtual Machine DC´s. After upgrade HOSTs from Hyper-V 2012 to Hyper-V 2012 R2, LDAP Query´s are very slow on the 2 Virtual DC´s. Has anyone ever went through the same problem? Thanks, Alexandre Smialoski

  • OAF Creating custom graph

    Hi, I am trying to build custom bar graph in OAF. I am able to display graph using below code and does not know how to pass OAGseries and OAGgroup values to the drill down page. Vector graphs = new Vector(); OAGraphTableBean graphTable = (OAGraphTabl