Not able to access /etc/sudoers.d/python file

0 votes

I am trying to add python to sudoers list. I opened the file /etc/sudoers.d/python once and entered some lines. After saving and exiting, I realized these were wrong. I am trying to open the file and make changes but it is not happening. I am getting error:

$ sudo visudo -f /etc/sudoers.d/python

>>> /etc/sudoers.d/python: syntax error near line 1 <<<
sudo: parse error in /etc/sudoers.d/python near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Feb 6 in Linux Administration by Mani

1 answer to this question.

0 votes

I think your system is not allowing you to access the sudoers file. Maybe because it is broken. Not sure about it. But I have a solution for this that worked for me. I used pkexec. Using pkexec to open the editor allowed me to open the editor and then make the changes. Try this:

pkexec visudo -f /etc/sudoers.d/python
answered Feb 6 by Lohit

Related Questions In Linux Administration

+1 vote
1 answer

Not able to install npm on Ubuntu

Try installing npm using aptitude: sudo apt install aptitude sudo ...READ MORE

answered Nov 28, 2018 in Linux Administration by Omkar
• 68,160 points
0 votes
1 answer

Not able to install sublime text editor

Delete the following file: /etc/apt/sources.lits.d/sublime-text.list and then try to ...READ MORE

answered Feb 18 in Linux Administration by Joe
0 votes
1 answer

how to loop through the content of a file using bash

One of the ways to do it ...READ MORE

answered Feb 15 in Linux Administration by ajs3033
• 7,280 points
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 412 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3 in Linux Administration by Omkar
• 68,160 points
0 votes
1 answer

How to install a deb file?

You can install a .deb file with ...READ MORE

answered Apr 1 in Linux Administration by Shaan