Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-26-2016, 05:00 PM
|
#1
|
LQ Newbie
Registered: Oct 2016
Posts: 1
Rep:
|
getting error using sudo commends. Explained below
/etc/sudoers: syntax error near line 31 <<<
sudo: parse error in /etc/sudoers near line 31
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
|
|
|
10-26-2016, 05:04 PM
|
#2
|
Senior Member
Registered: Feb 2009
Posts: 4,667
|
There is an error in line 31 of your /etc/sudoers file.
If you post it, we can help. Without seeing the file, it is hard to guess what the error might be.
|
|
|
10-26-2016, 06:23 PM
|
#3
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Rep:
|
And, sadly, when there is an error in the sudoers file, it can be literally impossible to fix unless you can somehow gain full root access to the server.
|
|
|
10-26-2016, 09:40 PM
|
#4
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
what did you change in sudoers file? whatever it is , it is located near or at line 31 ....
|
|
|
10-27-2016, 11:54 PM
|
#5
|
LQ Guru
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,634
|
Depending on your distro, there will be different ways around that. Most involve booting from the rescue disc or USB-stick that you have handy and fixing sudoers. When editing that file, it is a good idea to use the program "visudo" instead of directly working on it. You can still lock yourself out while using "visudo" but at least it will not be because of a syntax errror as it prevents those.
|
|
1 members found this post helpful.
|
10-28-2016, 06:31 AM
|
#6
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
Ask the admin of the machine.
|
|
1 members found this post helpful.
|
10-28-2016, 01:12 PM
|
#7
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by sneakyimp
And, sadly, when there is an error in the sudoers file, it can be literally impossible to fix unless you can somehow gain full root access to the server.
|
who said it was a server?
on a local machine, booting into "recovery mode" should do it.
but i agree, if this is a server, it's ... what was the netspeak abbreviation ... SOL, or contact the admin.
|
|
|
10-28-2016, 01:15 PM
|
#8
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
boot a different linux, USB one.
mount that drive then go in and edit it in god mode. save, exit, reboot the effected system, in like flint.
|
|
|
10-28-2016, 01:38 PM
|
#9
|
Member
Registered: Sep 2016
Location: USA
Posts: 275
Rep:
|
If you had used visudo to edit the /etc/sudoers file it would have prompted you if you made any errors before you could exit out of it. This way is alot more safer cus in case you made a mistake you will know beforehand, and be able fix it before it becomes an issue.
Last edited by linux4evr5581; 10-28-2016 at 01:41 PM.
|
|
1 members found this post helpful.
|
10-28-2016, 05:58 PM
|
#10
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Rep:
|
Quote:
Originally Posted by ondoho
who said it was a server?
|
Nobody. But how many times have you ever edited the sudoers file on a workstation or phone? Seemed a reasonable assumption to me. Perhaps it's not.
|
|
|
10-28-2016, 06:11 PM
|
#11
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
possibly able to open terminal and issue:
and if successful, then
and navigate to line 31 and do have a look at the line and the one(s) above and below, especially if you edited this file and made a mistake.
Lines can be commented if prefaced with a "#"
After editing sudoers using visudo correctly saving the file,
in the terminal, type and examine your system looking for the original error.
Last edited by Habitual; 10-28-2016 at 06:15 PM.
|
|
|
All times are GMT -5. The time now is 04:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|