I edited my sudoers file in /etc and after that I can't use sudo anymore. I get this whenever I issue the command:  sudo: &gt;&gt;&gt; /etc/sudoers: syntax error near line 30 &lt;&lt;&lt; sudo: parse error in /etc/sudoers near line 30 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   How to solve it?
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
113290
I have PATH=foo set in /etc/profile  According to /etc/password the root and myaccount users have /bin/bash as the login shell.  When I log in as myaccount, the PATH has been set correctly from /etc/profile. If I then sudo su, PATH does not include the value set in /etc/profile.  If I sudo su - instead then /etc/profile is sourced. I know it is good practice to do this anyway but I don't see why it's necessary in order to source /etc/profile.  Why does sudo su clobber PATH, disregarding /etc/profile and how to I make it not?
52281
While trying to follow , I encountered the following error while attempting what seems like a simple sudo edit operation:  $  sudo gedit /var/lib/dpkg/status  ** (gedit:14898): WARNING **: Command line `dbus-launch --autolaunch=0bd873023a78bdb34ca1b9650000000b --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n Cannot open display:  Run 'gedit --help' to see a full list of available command line options.   Running the same without sudo correctly launches gedit, but of course without editing ability. Does anyone have any idea what is going on?
35253
I accidentally deleted the /usr/bin/sudo file. How can I restore it?  I have found , but it seems to be not solved.
38187
I faced this issue when I want to use sudo command :  sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   then I tried a solution from a similar question in order to change the owner back to the root:   $ pkexec visudo   also I tried this one   $ pkexec chown root:root /etc/sudoers /etc/sudoers.d -R   but I have faced another issue with these commands:   Error getting authority: Error initializing authority: Could not connect: No such file or directory   So is there a solution to this issue?    Full shell issue snippets:   ubuntu@LAPTOP-D4T16P7J:~$ sudo -i sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin ubuntu@LAPTOP-D4T16P7J:~$ pkexec visudo Error getting authority: Error initializing authority: Could not connect: No such file or directory ubuntu@LAPTOP-D4T16P7J:~$ pkexec chown root:root /etc/sudoers /etc/sudoers.d -R Error getting authority: Error initializing authority: Could not connect: No such file or directory     This is my /etc/sudoers file:   ubuntu@LAPTOP-D4T16P7J:~$ cat /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # 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  # 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     OS info:    Ubuntu WSL2.
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.
1809
In /etc/sudoers I see this:  # Allow members of group sudo to execute any command after they have # provided their password # (Note that later entries override this, so you might need to move # it further down) %sudo ALL=(ALL) ALL   So how do I add a user to that sudo group?
74000
My /etc/sudoershas content:  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  # 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   There is no rule above specifying NOPASSWD. I was wondering  why user root seem to be able to execute any command as any user without providing password?  Thanks.
68265
I'm looking for a good, consistent and easy way to do a report of sudoers permissions for every user and group on the system. For users, I want the report to include permissions granted via group membership.
26639
I was playing around with aliases today and I noticed that aliases don't seem to be available whilst using sudo:  danny@kaon:~$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias ls='ls --color=auto'  danny@kaon:~$ ll -d / drwxr-xr-x 23 root root 4096 2011-01-06 20:29 //  danny@kaon:~$ sudo -i root@kaon:~# ll -d / drwxr-xr-x 23 root root 4096 2011-01-06 20:29 // root@kaon:~# exit logout  danny@kaon:~$ sudo ll -d / sudo: ll: command not found   Is there any reason why you cannot use aliases whilst using sudo?
43460
When I login as guest I am unable to execute any command with sudo.  E.g.:  sudo ps   returns:  sudo: unable to change to sudoers gid: Operation not permitted   How can I fix this?
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?
70828
I want to do:  echo "something" &gt;&gt; /etc/config_file  But, since only the root user has write permission to this file, I can't do that. But the following also doesn't work.  sudo echo "something" &gt;&gt; /etc/config_file   Is there a way to append to a file in that situation without having to first open it with a sudo'd editor and then appending the new content by hand?
50998
Accidentally removed my gnome desktop and am stuck in tty1. Trying to reinstall the desktop and keep getting the error "user is not in the sudoers file". Having trouble adding my user, new to debian and am not sure how to correctly open/edit sudoers from tty1 (or really how to edit files from cmd line for that matter if someone could please lend some specifics)!
18416
I was running a Python script that malfunctioned and used sudo to create a file named &gt;.  How can I get rid of this file?  Of course, when I try sudo rm &gt;, I get the error bash: syntax error near unexpected token 'newline', because it thinks I'm trying to redirect the output of rm.  Its permissions are -rw-r--r--.
101082
I have done this:  sudo chown -R myname /usr/   and now I can't use the sudo command because of this error:     sudo: must be setuid root   And as I read this means that the owner of this file /usr/bin/sudo is not the root. It's my user now because of the chown on the /usr folder.  On many forums and blogs people suggest to do this as root:  # chown root:root /usr/bin/sudo # chmod 4111 /usr/bin/sudo   ...but the problem with this is that I need to log in as a root, but I can't because If I write su in the terminal the password is wrong (actually I use the password what I added to my user):   $ su Password: su: Authentication failure   So can I get back the sudo command?  Edit: My Ubuntu is under Paralells on my Mac OS X.
383
I updated to Ubuntu 20.04. When I use the default terminal, everything is fine. But if try to use terminator, I cannot use sudo. I get permission denied. Again, only when using terminator.  How can I sudo from the terminator? I really would like to continue to use a terminator.  Edit: I just also noted that it cannot find make either. I guess it's all messed up. I'll try to uninstall it and install again I guess.