I get the following error every time I run Sudo commands : sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin  I used to be able to run such commands but now, anything I do on terminal ends up with the same result. I'm running on MacOS Catalina. Hope someone will be able to help me out
123735
When I use the sudo command I get an error message.  sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   If I try to use chmod on sudoers I get the message "Operation not permitted". Can someone help me fix things so sudo works again?
45209
I have recently joined Ubuntu version 16.04. When i open the terminal it displays this message "To run a command as administrator(user "root"), use sudo command ". Please help me with this problem asap.  It happened to me (@waltinator), too. I did CtrlAltt to open a teminal, and is my wont, did 3 CtrlShiftt to open additional teminal screens. The additional screens got the message:  To run a command as administrator (user "root"), use "sudo &lt;command&gt;". See "man sudo_root" for details.   before my .bashrc finished.    I can't find anywhere in my .bashrc or its included files where I attempt to sudo anything (sounds like a Bad Idea) during my login process. I do set up aliases that sudo when evaluated, but not when defining the alias:  $ egrep 'sudo |su ' .bashrc .bash_aliases /etc/profile.d/color_ls.sh etc/bash_path_funcs/*  .bashrc:# makes "sudo" easier: sudo less $LESS files .bash_aliases:alias bigopenfiles="sudo lsof / | awk '{if(\$7 &gt; 1048576) print \$7/1048576 \"MB\" \" \" \$9 }' | sort -n -u"  .bash_aliases:alias deletedfiles="sudo lsof / | egrep 'PID|\(deleted\)'" .bash_aliases:alias bigopenfiles="sudo lsof / | awk '{if(\$7 &gt; 1048576) print \$7/1048576 \"MB\" \" \" \$9 }' | sort -n -u"  .bash_aliases:alias deletedfiles="sudo lsof / | egrep 'PID|\(deleted\)'" .bash_aliases:alias aptfixkey="sudo gpg --keyserver keyserver.ubuntu.com --recv-keys " .bash_aliases:alias susp="sudo -v &amp;&amp; sleep 20 &amp;&amp; echo 'Zzzzzzzzzzzzzzzzzzzzz' &amp;&amp; date &amp;&amp; sudo pm-suspend &amp;&amp; date &amp;&amp; echo 'Awake'" .bash_aliases:alias update='wupdatestatus=99;while [[ $wupdatestatus -ne 0 ]] ; do sudo apt-get update; wupdatestatus=$?;echo "status=$wupdatestatus";if [[ $wupdatestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias upgrade='wupgradestatus=99;while [[ $wupgradestatus -ne 0 ]] ; do sudo apt-get upgrade; wupgradestatus=$?;echo "status=$wupgradestatus"; if [[ $wupgradestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias upgradedl='wupgradestatus=99;while [[ $wupgradestatus -ne 0 ]] ; do sudo apt-get --download-only upgrade; wupgradestatus=$?;echo "status=$wupgradestatus"; if [[ $wupgradestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias dist-upgrade='wupgradestatus=99;while [[ $wupgradestatus -ne 0 ]] ; do sudo apt-get dist-upgrade; wupgradestatus=$?;echo "status=$wupgradestatus"; if [[ $wupgradestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias wup='wifi;sudo rmmod rt2800usb;sudo modprobe rt2800usb;nmcli con up id Nick;wifi;ping3 slashdot.org' .bash_aliases:    sudo tail -n 50 $( ls -rt1 /var/log |sed -e 's%^%/var/log/%'| tail -n 6 ) grep: /etc/profile.d/color_ls.sh: No such file or directory   None of the logs help:  $ sudo grep -l sudo /var/log/* /var/log/*/* 2&gt;/dev/null     shows nothing interesting.  How do I track down who/what is trying to sudo when I login?
36380
On busy days, I'd like to run   $ ./configure &amp;&amp; make &amp;&amp; sudo make install &amp;&amp; halt   on the night and go to bed, hoping the application would automatically be installed. But what I see the next day is the screen where sudo asks me for the password. So how could I run sudo with password in one command line, or is there any other method to do this?
46798
I used sudo -H gedit /etc/environment command on terminal to permanently change my PATH variable.  To correct it, I pressed Ctrl+Alt+F1, and used export PATH command, but access was denied.   Many commands (including sudo and nano) are not recognized as the new PATH variable doesn't have /usr/bin. I am new to Linux commands.   How can I fix this?
98077
$ sudo -iu abc ls -ltr /sites/servers/server_instance/logs/access* ls: cannot access /sites/servers/server_instance/logs/access*: No such file or directory  $ sudo -iu abc ls -ltr /sites/servers/server_instance/logs/ total 594812 -rwxrwxrwx 1 abc abc      45 Mar 21 12:42 old.log -rwxrwxrwx 1 abc abc      304537970 Mar 24 12:45 console.log -rwxrwxrwx 1 abc abc      304537970 Mar 24 13:20 access_nginx.log   Can anyone explain why this happens? I am stuck on a script due to this.
96339
When I run sudo gedit /path/to/some/random/file I get the following error    ** (gedit:6262): WARNING **: Command line `dbus-launch --autolaunch=7f8731869e1c690b8205727e0000000a --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed. Cannot open display:  Run 'gedit --help' to see a full list of available command line options.     Using gksudo doesn't help either which returns    Cannot open display:  Run 'gedit --help' to see a full list of available command line options.     Any help guys. I need to have this capability to open files in Gedit as root. I found this question with the same error but no solution     EDIT I found this post in . These are the instructions:     echo $DISPLAY # you'll be needing this value 3 lines below sudo -i # or "su -" on older Slackwares xauth merge ~alien/.Xauthority # use your own username here instead of "alien" export DISPLAY=:0.0 # use the value of DISPLAY you've seen 3 lines before     On coming to command #3, I got this error xauth:  file /root/.Xauthority does not exist    Maybe this new info can shed more light.
35724
If I issue sudo my-command  how does Linux look for that my-command? The my-command is in my PATH. I can invoke it without any problem. However, when I invoke it with sudo, I'll get command not found. How to overcome it? EDIT: That &quot;Possible duplicate&quot;'s selected answer is wrong, well, at least not to the point. This answer, from terdon, is the correct one.
56449
$ source /etc/environment   $ sudo source /etc/environment  [sudo] password for t:  sudo: source: command not found   It seems that a different shell than bash is run to execute source /etc/environment and that shell doesn't have source as builtin.   But my and the root's default shells are both bash.  $ echo $SHELL /bin/bash   If sudo indeeds uses a different shell, why is it? I saw , but don't understand in my case.
34963
It is company policy for admins to login to the servers via a personal username, and then run sudo -i to become root.  Upon running sudo -i, sudo will create an environmental variable called SUDO_USER, which contains the original user's username.  Is there a way to log ALL commands within syslog with something akin to the following syntax:  ${TIME/DATE STAMP}: [${REAL_USER}|${SUDO_USER}]: ${CMD}   An example entry would be:  Sat Jan 19 22:28:46 CST 2013: [root|ksoviero]: yum install random-pkg   Obviously it doesn't have to be exactly the above syntax, it just has to include a minimum of the real user (eg. root), the sudo user (eg. ksoviero), and the full command that was run (eg. yum install random-pkg).  I've already tried snoopy, but it did not include the SUDO_USER variable.
17150
How do I edit an invalid sudoers file? It throws the below error and it's not allowing me to edit again to fix it.  Here is what happens:  $ sudo visudo &gt;&gt;&gt; /etc/sudoers: syntax error near line 28 &lt;&lt;&lt; sudo: parse error in /etc/sudoers near line 28 sudo: no valid sudoers sources found, quitting
29717
Whenever I try to install or remove something using terminal it gives the following error message:  bluebird@bluebird:~$ sudo apt-get update sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins bluebird@bluebird:~$ sudo apt-get remove vlc sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins bluebird@bluebird:~$ sudo apt-get install apt-file sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins
32153
How can I fix the following error with sudo?  /etc$ sudo sudo: /etc/sudoers.d is world writable usage: sudo [-D level] -h | -K | -k | -V usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user             name|#uid] usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user             name] [-u user name|#uid] [-g groupname|#gid] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g             groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]             [VAR=value] [-i|-s] [&lt;command&gt;] usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g             groupname|#gid] [-p prompt] [-u user name|#uid] file ...
41141
I messed around with the sudoers file without really knowing what I was doing using   Assume I did everything that was in the top answer along with editing it with vim and not visudo. How do I fix this?  I'm running Xubuntu 12.04, and I didn't set a root password.
121443
This is a sudoers file which I have on a Debian 9 server and it works.  /etc/sudoers contains:  Defaults    env_reset Defaults    mail_badpass Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root        ALL=(ALL:ALL) ALL # the following line I've added for sudo to work on Debian, which by default does not vlastimil   ALL=(ALL:ALL) ALL # and this line I've added just now, so I could enable / disable teamviewer daemon as I wish vlastimil   ALL = (root) NOPASSWD: /usr/bin/teamviewer  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d   Meaning I can now run e.g. the following without entering password:  sudo teamviewer daemon disable sudo teamviewer daemon enable   This, however, is a non-working sudoers file on Linux Mint 18 in a sense, it still asks me for password. /etc/sudoers contains:  Defaults    env_reset Defaults    mail_badpass Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root        ALL=(ALL:ALL) ALL # this line I've added myself, because I felt it is needed, however user vlastimil has had sudo access all the time, added just now vlastimil   ALL=(ALL:ALL) ALL # and this line I've added just now, so I could enable / disable teamviewer daemon as I wish, but it does not work vlastimil   ALL = (root) NOPASSWD: /usr/bin/teamviewer  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d   I guess there is some difference between Debian and Mint, which makes the added lines non-working.  I read different answers like on this page:    But I am not clever from it.  EDIT1:  The first answer gives on Linux Mint a strange error:  $ sudo /usr/bin/teamviewer  Init...  *** TeamViewer can not be executed with sudo! ***  Either use your normal user account without sudo  or use a the real root account to log in to your desktop (not recommended!).   I don't get this either.    $ which teamviewer /usr/bin/teamviewer  $ file /usr/bin/teamviewer /usr/bin/teamviewer: symbolic link to /opt/teamviewer/tv_bin/script/teamviewer  $ file /opt/teamviewer/tv_bin/script/teamviewer  /opt/teamviewer/tv_bin/script/teamviewer: Bourne-Again shell script, ASCII text executable  $ cat /opt/teamviewer/tv_bin/script/teamviewer #!/bin/bash  # If you see this message, you probably attempted to start TeamViewer. # Please open a terminal (Konsole, gnome-terminal, xterm), # navigate to this folder (type 'cd /path/to/teamviewer' [Enter]) # then execute TeamViewer (type './teamviewer' [Enter])   TV_SCRIPT_DIR="$(dirname "$(readlink -e "$0")")" source "$TV_SCRIPT_DIR/tvw_main"  Main "$@"   EDIT2:  For instance on AskUbuntu, as suggested in comments:    and on many other places, there is a solution where they put the rule after admin group rule. I've tried it, even rebooted afterwards, but it's still not working.
2993
I want to stop having to use sudo everytime I work in /var/www. How can I do that? I simply want to put all of my sites into this directory and work with them without too much pain.
84203
Recently I had to change the folder permissions of /usr folder. Now the whole sudo is not working. If I try to update my system using this command:  sudo apt-get update   I get the following message:  sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins   So I tried to change the folder permissions by opening Nautilus as root by using this command  gksudo nautilus   But nothing happened. Nautilus didn't open. This is an emergency as the whole of sudo is not working. when I tried searching the solution from Google many suggested re-installation. I don't prefer re-installation. so is there any other solution?
117246
I've created a user called kafka to whom I am trying to give a sudo access to run only /etc/init.d/kafka commands.   I added the following entry to /etc/sudoers.d/kafka via Ansible:  kafka ALL = NOPASSWD: /etc/init.d/kafka  However, this breaks sudo completely with the following error:     /etc/sudoers.d/kafka: syntax error near line 1       sudo: parse error in /etc/sudoers.d/kafka near line 1       sudo: no valid sudoers sources found, quitting       sudo: unable to initialize policy plugin    Here's the full Ansible snippet:  - name: Create kafka user's group   group:     name: "{{ kafka_group }}"     state: present  - name: Create kafka user   user:     name: "{{ kafka_user }}"     state: present     group: "{{ kafka_group }}"     shell: /bin/bash  - name: Set up password-less sudo for kafka user   copy:     content: "{{ kafka_user }} ALL = NOPASSWD: /etc/init.d/{{ kafka_service_name }}"     dest: "/etc/sudoers.d/{{ kafka_user }}"     owner: root     group: root     mode: 0440   What am I doing wrong?