0

I want to run pycharm as root by this instruction and this, but i have made mistake and don't added : in this script: user host = (root) NOPASSWD: full_path_to_python in /etc/sudoers.d/python file.

So now I can not edit it anymore, by this instruction and more from internet like as you can see below ( also i have changed the admin user pass and forget previous pas , so now i can not use su root !):


so@so-notebook:/etc/sudoers.d$ sudo gedit 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
so@so-notebook:/etc/sudoers.d$ su so
Password: 
so@so-notebook:/etc/sudoers.d$ sudo gedit
>>> /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
so@so-notebook:/etc/sudoers.d$ nano
Use "fg" to return to nano.

[3]+ Stopped nano so@so-notebook:/etc/sudoers.d$ sudo nano 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 so@so-notebook:/etc/sudoers.d$ sudo visudo -f 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 so@so-notebook:/etc/sudoers.d$ su root Password: su: Authentication failure so@so-notebook:/etc/sudoers.d$ sudo -i
>>> /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 so@so-notebook:/etc/sudoers.d$ so@so-notebook:/etc/sudoers.d$ sudo bash >>> /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 so@so-notebook:/etc/sudoers.d$ sudo -s >>> /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 so@so-notebook:/etc/sudoers.d$ sudo apt-get update >>> /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 so@so-notebook:/etc/sudoers.d$ so@so-notebook:/etc/sudoers.d$ sudo apt-get update >>> /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

my OS version is:

so@so-notebook:~/Desktop/trash/s$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

Thanks.

Soheil Paper
  • 1,417

1 Answers1

0

I have gone in python folder and tried :

so@so-notebook:/etc/sudoers.d$ sudo visudo -f python

As you can see at question, but i restated and tried :

pkexec visudo -f /etc/sudoers.d/python From here,and add : in python scrip, so problem solved.

Soheil Paper
  • 1,417