3

sudo from a standard user works fine, but when I try to use it from root it returns this error:

sudo: can't open /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting

/etc/sudoers has the appropriate 755 attribute and owned by root:root I even recreated it with visudo, all fine, but error persists. /etc is 755 and also owned by root:root, I even tried to reinstall sudo: no difference.

I need to sudo from root because I use a python script which uses sudo to run os privileged commands. But now I'm running that python script at boot time and it crashes due to this issue. I installed the same version of the OS in a Virtual Box VM and it works fine.

What can be keeping root from running sudo?

αғsнιη
  • 35,660
user263657
  • 327
  • 1
  • 3
  • 10
  • @KasiyA, actually it's not a duplicate, because the solution to my problem was found on a totally different perspective and suggesting it's a duplicate can mislead users with the same issue as my installation had. – user263657 Apr 02 '15 at 12:53
  • You should have updated your question to indicate you had changed ownership and/or permissions of system files and or updated the question as to why you feel it is not a duplicate (rather then leaving a comment). Without that information your question is incomplete and misleading, thus marked as a duplicate. I am voting to close as unclear what you are asking for these reasons. – Panther Apr 06 '15 at 13:14

1 Answers1

3

Can you change directory to / ? being in root user? May be you are missing permission to this path / as root

See https://unix.stackexchange.com/questions/39328/sudo-cannot-open-etc-sudoers

http://arstechnica.com/civis//viewtopic.php?t=1170439

Aravinda
  • 982
  • Thanks, @Aravinda, yes I seem to be able to do much everything while logged as root, except executing the sudo command. – user263657 Apr 02 '15 at 11:41
  • Hold on! My / folder is not owned by root! I'm gonna change that now and see if that fix the issue (thanks for your added links, @Aravinda) – user263657 Apr 02 '15 at 11:49
  • 2
    Do not change ownership or permissions of system files, you will break Ubuntu. – Panther Apr 06 '15 at 13:13