Parse Error In /etc/sudoers Near Line 17
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 might have Meta Discuss fix broken sudoers file the workings and policies of this site About Us Learn more about
Sudo: No Valid Sudoers Sources Found, Quitting Sudo: Unable To Initialize Policy Plugin
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions /etc/sudoers.d/50_stack_sh: syntax error near line 1 Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's
/etc/sudoers Is World Writable
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 159 down vote favorite 64 How do I edit an invalid visudo file? Here is what happens: no valid sudoers sources found quitting centos $ 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.9k1458110 asked Oct 30 '11 at 19:15 YumYumYum 3,3992477119 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 235 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 user) are authorized to run programs as root with PolicyKit, you can enter your password, and then it will run visudo as root,
Asked by Ceaser Webb on 2010-09-16 Tried to download virtual box and received error msg: Previous installation hasn't
Default Sudoers File
been completed. The installation could have failed because of an
Pkexec
error in the corresponding software package or it was cancelled in an unfriendly way. You have to no valid sudoers sources found quitting ubuntu 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: syntax error near line http://askubuntu.com/questions/73864/how-to-modify-a-invalid-etc-sudoers-file-it-throws-out-an-error-and-not-allowi 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 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 https://answers.launchpad.net/ubuntu/+source/sudo/+question/125653 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 <<< 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
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 http://raspberrypi.stackexchange.com/questions/10029/etc-sudoers-file-is-completely-corrupted-parse-error-in-etc-sudoers this site About Us Learn more about Stack Overflow the company Business http://astrails.com/blog/2009/9/29/how-to-fix-a-hosed-etc-sudoers-file-on-mac-osx Learn more about hiring developers or posting ads with us Raspberry Pi Questions Tags Users Badges Unanswered Ask Question _ Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute: Sign up no valid Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top /etc/sudoers file is completely corrupted parse error in /etc/sudoers up vote 1 down vote favorite When I edited my sudoers file & saved it on my Raspberry Pi, it's giving me: sudo: parse error in /etc/sudoers near line 26 sudo: no valid sudoers no valid sudoers sources found, quitting sudo: unable to initialize policy plugin on raspberry pi I am trying to avoid sudo permissions for a bash which is trying to access a root file. I also tried pkexec, like a general Linux solution, but it's giving -bash: pkexec: command not found Now this error is showing everywhere I go using sudo. Is there any solution for this? raspbian sudo share|improve this question edited Mar 11 at 13:15 S.L. Barth 103114 asked Oct 9 '13 at 8:48 Ayush 612 1 Is it possible to provide the couple of lines before and after line 26 so we can see what the issue may be. –Hurgh Oct 9 '13 at 21:24 @Hurgh, you need root permissions to read sudoers –John La Rooy Oct 9 '13 at 22:03 Boot off a live cd and mount the partition will allow you to view/edit/fix the sudoers file. –Hurgh Oct 10 '13 at 0:00 if i can access any how to sudoers this discussion is not being taken place here. on every sudo permission giving same thing s
did sudo vim /etc/sudoers and added the following to it: Cmnd_Alias GEM_INSTALL = /usr/bin/gem install * Cmnd_Alias GEM_UNINSTALL = /usr/bin/gem uninstall * vitaly ALL=NOPASSWD GEM_INSTALL vitaly ALL=NOPASSWD GEM_UNINSTALL The intention was to grant myself permissions to install gems w/o entering password. I know its insecure, but this is security-vs-convinience kind of thing and I only intended to leave it there for a couple of hours while I do some heavy gem development. Anyway, experienced unix users might have spotted the syntax error in my sudoers edits. I forgot the : just after the NOPASSWD. But the problem is even more basic then that. I shouldn't have beed editing the file directly. I should have known better. And now I'm paying the price: $ sudo >>> sudoers file: syntax error, line 36 <<< >>> sudoers file: syntax error, line 37 <<< sudo: parse error in /private/etc/sudoers near line 36 $ sudo vim /etc/sudoers >>> sudoers file: syntax error, line 36 <<< >>> sudoers file: syntax error, line 37 <<< sudo: parse error in /private/etc/sudoers near line 36 OOPS! Now the sudoers file is broken and I can't even fix it since I was using sudo to edit it! Never do that! :) Use the visudo command. it will check the file syntax before 'commiting' it. Now what? I looked at the net and the general consensus is that you need to boot into a single-user mode to fix it. I really really didn't want to do it. I have 4G of RAM and so I'm usually running dozens of programs and its a pain to close and reopen them all after boot. I'm lazy :) Then I thought there might be a better way. First I checked the permissions on the sudoers file: $ ls -l /etc/sudoers -r--r-----+ 1 root wheel 1302 Sep 28 17:20 /etc/sudoers and only 'root' is in the group wheel, so no luck here. I also couldn't 'su root' since my root user doesn't have a password. duh! But then it appeared to me that I might be able to circumvent this protection by leveraging my OS X 'admin' status. After all it ought to count for something :). I opened "/etc" folder in finder (Go -> Go to Folder...), then opened sudoers file properties. Opening the lock there doesn't require to be a root. Its enough to be an Admin and my Admin user does have a password! So I was easi