Etc/sudoers Syntax Error Near Line 24
Contents |
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin might have Meta Discuss the workings and policies of this site /etc/sudoers.d/50_stack_sh: syntax error near line 1 About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting /etc/sudoers is world writable ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; no valid sudoers sources found quitting centos it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to modify a invalid /etc/sudoers file? It throws out an error and not allowing me to edit again up vote 158 down vote favorite 63
Default Sudoers File
How do I edit an invalid visudo file? Here is what happens: $ sudo visudo >>> /etc/sudoers: syntax error near line 28 <<< sudo: parse error in /etc/sudoers near line 28 sudo: no valid sudoers sources found, quitting sudo visudo share|improve this question edited Oct 11 '14 at 16:47 KasiyA 13.7k1456109 asked Oct 30 '11 at 19:15 YumYumYum 3,3772477119 2 great question considering this page creates that error help.ubuntu.com/community/RootSudoTimeout –user128334 Sep 21 '13 at 18:14 add a comment| 13 Answers 13 active oldest votes up vote 234 down vote accepted +50 On a modern Ubuntu system (and many other GNU/Linux distributions), fixing a corrupted sudoers file is actually quite easy, and doesn't require rebooting, using a live CD, or physical access to the machine. To do this via SSH, log in to the machine and run the command pkexec visudo. If you have physical access to the machine, SSH is unnecessary; just open a Terminal window and run that pkexec command. Assuming you (or some other
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About
Pkexec
Us Learn more about Stack Overflow the company Business Learn more about hiring developers etc sudoers syntax error near line what now or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question pkexec command not found and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted http://askubuntu.com/questions/73864/how-to-modify-a-invalid-etc-sudoers-file-it-throws-out-an-error-and-not-allowi up and rise to the top Sudo doesn't work up vote 5 down vote favorite 2 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: >>> /etc/sudoers: syntax error near line 30 <<< sudo: parse error in /etc/sudoers near line 30 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin http://askubuntu.com/questions/170216/sudo-doesnt-work How to solve it? sudo share|improve this question edited Jul 31 '12 at 1:28 Eric Carvalho 28.1k1576105 asked Jul 31 '12 at 0:50 Dominic 32126 8 That's why you're supposed to use visudo for editing /etc/sudoers –Sergey Jul 31 '12 at 3:48 related question -> what-are-the-differences-between-sudo-su-visudo-chroot-and-gksu –hhlp Jan 2 '13 at 17:47 add a comment| 4 Answers 4 active oldest votes up vote 5 down vote accepted Boot into recovery mode from the GRUB menu (hold the SHIFT key during boot to reveal this menu), enter the root shell. First you need write permission to edit sudoers, so run mount -o remount,rw / Then use visudo and revert your mistake. visudo will check if the resulting sudoers file conforms to the required syntax. By default visudo uses vi as editor, but you can tell it to use your favourite text editor with the EDITOR environment variable, e. g.: EDITOR=nano visudo share|improve this answer edited Feb 9 '15 at 17:29 David Foerster 10.7k93052 answered Jul 31 '12 at 0:56 Cumulus007 2,5131422 2 Please include in your answer an advice to use visudo to make any change to the sudoers file. –Eric Carvalho Jul 31 '12 at 1:24
Asked by Ceaser Webb on 2010-09-16 Tried to download virtual box and received error msg: Previous installation hasn't been completed. The installation could have failed because of an error in the corresponding software https://answers.launchpad.net/ubuntu/+source/sudo/+question/125653 package or it was cancelled in an unfriendly way. You have to repair this before you can install or remove any further software. I then tried the terminal: sudo apt-get install-f Then I received this: https://ubuntuforums.org/showthread.php?t=2036382 syntax error near line 17 <<< sudo: parse error in /etc/sudoers near line 17 sudo: no valid sudoers sources found, quitting I have NO idea of what I should do. Question information Language: English Edit syntax error question Status: Answered For: Ubuntu sudo Edit question Assignee: No assignee Edit question Last query: 2010-09-18 Last reply: 2016-02-11 Related bugs Link existing bug Related FAQ: None Link to a FAQ Rohit R (rr0hit) said on 2010-09-16: #1 Please paste the contents of /etc/sudoers file in paste.ubuntu.com and provide the link here Ceaser Webb (ceaserw) said on 2010-09-16: #2 ceaser@ceaser-laptop:~$ sudo apt-get install -f >>> /etc/sudoers: syntax error near line 17 syntax error near <<< sudo: parse error in /etc/sudoers near line 17 sudo: no valid sudoers sources found, quitting ceaser@ceaser-laptop:~$ /ect/sudoers file bash: /ect/sudoers: No such file or directory ceaser@ceaser-laptop:~$ /etc/sudoers file bash: /etc/sudoers: Permission denied ceaser@ceaser-laptop:~$ /etc/sudoers bash: /etc/sudoers: Permission denied ceaser@ceaser-laptop:~$ It said permission denied, or maybe I looked in the wrong place. Download as text --- On Thu, 9/16/10, rohit
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [SOLVED] Can't Access Sudoers File in Ubuntu, Kubuntu, Xubuntu Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Results 1 to 8 of 8 Thread: Can't Access Sudoers File in Ubuntu, Kubuntu, Xubuntu Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode August 1st, 2012 #1 gdawg View Profile View Forum Posts Private Message 5 Cups of Ubuntu Join Date May 2010 Location New Mexico, USA Beans 39 DistroUbuntu 10.04 Lucid Lynx Can't Access Sudoers File in Ubuntu, Kubuntu, Xubuntu I managed to somehow mess-up /etc/sudoers file and now I am unable to access it. I added 2 users to the file using 'sudo visudo' command and apparently messed something up. Here are the results of attempts to access file: Code: jane@gdawg-Inspiron-530s:~$ sudo visudo sudo: >>> /etc/sudoers: syntax error near line 9 <<< sudo: >>> /etc/sudoers: syntax error near line 9 <<< sudo: parse error in /etc/sudoers near line 9 sudo: no valid sudoers sources found, quitting... sudo: unable to initialise policy plug-in I recently installed Ubuntu Remix. All help is welcome. Linux gdawg-Inspiron-530s 3.2.0-27-generic-pae #43-Ubuntu SMP Fri Jul 6 15:06:05 UTC 2012 i686 i686 i386 GNU/Linux Adv Reply August 1st, 2012 #2 drs305 View Profile View Forum Posts Private Message Staff Emeritus Join Date Jan 2007 BeansHidden! DistroUbuntu Development Release Re: Can't Access Sudoers File in Ubuntu, Kubuntu, Xubuntu Take a look at psychocat's page on fixing sudo: http://www.psychocats.net/ubuntu/fixsudo GRUB2 Retired. Adv Reply August 1st, 2012 #3 NikTh View Profile View Forum Posts Private Message Visit Homepage Ubuntu Member Join Date Feb 2012 Location el_GR BeansHidden! DistroUbuntu 14.04 Trusty Tahr Re: Can't Access Sudoers File in Ubuntu, Kubuntu, Xubuntu Hi , please open a terminal and run Code: pkexec gedit /etc/sudoers copy-paste below code inside (DELETE everything else , if any) Code: # /etc/sud