Linux Lite Forums

Software - Support => Other => Topic started by: chicknfangz on February 16, 2016, 05:04:29 PM

Title: Need help sudoers file
Post by: chicknfangz on February 16, 2016, 05:04:29 PM
Hi jerry or anybody else


I need some help please  :'(

I messerd with something in /etc/sudoers in terminal and deleted the # in root and ALL ALL ALL. I shouldn't have and asked first  :'( :'( :'(

I get this now
 
Code: [Select]
>>> /etc/sudoers: syntax error near line 19 <<<
>>> /etc/sudoers: syntax error near line 25 <<<
sudo: parse error in /etc/sudoers near line 19
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin


I was trying to go into SU in terminal but it was saying this su: Authentication failure

was trying to update grub with this but you have to be in root mode

Code: [Select]
grub-mkconfig -o /boot/grub/grub.cfg
Can you help me fix this please

Thank you

Title: Re: Need help sudoers file
Post by: rokytnji on February 16, 2016, 08:09:04 PM
My stock /etc/sudoers file below.

Code: [Select]
harry@misohorny1:~$ sudo -i
[sudo] password for harry:
root@misohorny1:~# cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo    ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

You can make a new one and fix yours by replacing it with mine. Just more info below

Code: [Select]
root@misohorny1:~# cd /etc/sudoers.d
root@misohorny1:/etc/sudoers.d# ls
README
root@misohorny1:/etc/sudoers.d# cat README
#
# As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
# installation of the package now includes the directive:
#
#     #includedir /etc/sudoers.d
#
# This will cause sudo to read and parse any files in the /etc/sudoers.d
# directory that do not end in '~' or contain a '.' character.
#
# Note that there must be at least one file in the sudoers.d directory (this
# one will do), and all files in this directory should be mode 0440.
#
# Note also, that because sudoers contents can vary widely, no attempt is
# made to add this directive to existing sudoers files on upgrade.  Feel free
# to add the above directive to the end of your /etc/sudoers file to enable
# this functionality for existing installations if you wish!
#
# Finally, please note that using the visudo command is the recommended way
# to update sudoers content, since it protects against many failure modes.
# See the man page for visudo for more information.
#
root@misohorny1:/etc/sudoers.d#
Title: Re: Need help sudoers file
Post by: chicknfangz on February 16, 2016, 11:44:26 PM
How do i do this  :(
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 02:42:14 PM
Waiting........ :(
Title: Re: Need help sudoers file
Post by: Wirezfree on February 17, 2016, 02:53:20 PM
Hi,

The forum is really, really good, the best in my opinion.
It relies on the goodwill and knowledge of folks on here.
You may have to wait a little for the right person to come along...
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 03:16:51 PM
OK thank you Wirezfree. Thats what i will be doing  ;D
Title: Re: Need help sudoers file
Post by: shaggytwodope on February 17, 2016, 03:45:11 PM
Carefully enter this command:

Code: [Select]
pkexec visudo
Enter your password, and your editor will open with the sudoers file. You can now do one of many things, use the default example posted above, or share the offending lines in the error message you had with us to figure out for you.


That aside, why do you need to touch grub? Show caution with that command.

Do not ever use any other means to modify sudoers, outside of the normal visudo command. It will notify you of errors before saving it, and even offer prompt to edit the file again.
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 05:30:42 PM
Carefully enter this command:

Code: [Select]
pkexec visudo
Enter your password, and your editor will open with the sudoers file. You can now do one of many things, use the default example posted above, or share the offending lines in the error message you had with us to figure out for you.


That aside, why do you need to touch grub? Show caution with that command.

Do not ever use any other means to modify sudoers, outside of the normal visudo command. It will notify you of errors before saving it, and even offer prompt to edit the file again.

 use the default example posted above, or share the offending lines in the error message you had with us to figure out for you.

I did share them above.

How do i use that example. It has hes username in it. So what do i do and how do i do this?


I was trying to go into SU root. But it said su: Authentication failure. And i was typing my password correctly. SO thats not an issue



Title: Re: Need help sudoers file
Post by: shaggytwodope on February 17, 2016, 06:06:21 PM
Understand this, the output of your original post means nothing to me. As I can not see any modifications you've made. Now if you use the command I posted and copy the lines mentioned in your original post and share them... (line 19 and 25) we can FIX them for you. Otherwise you can simply use the default shared.


With no modifcations this is the default sudoers file:
Code: [Select]
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo    ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d


Using the command
Code: [Select]
pkexec visudo

Will allow you to edit the sudoers file properly, and you can resume using sudo after this is solved.
Title: Re: Need help sudoers file
Post by: Jerry on February 17, 2016, 06:13:45 PM

I did share them above. If you can read?

...I never said i needed to touch grub. READE THE ABOVE!!


Try to be respectful to those offering their time to help you, that kind of response will put people off wanting to help you.
The tone of the Forum here is friendly, and we will jealously defend that image.
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 06:30:51 PM

OK will do jerry Thanks

 
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 06:46:03 PM
Understand this, the output of your original post means nothing to me. As I can not see any modifications you've made. Now if you use the command I posted and copy the lines mentioned in your original post and share them... (line 19 and 25) we can FIX them for you. Otherwise you can simply use the default shared.


With no modifcations this is the default sudoers file:
Code: [Select]
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo    ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d


Using the command
Code: [Select]
pkexec visudo

Will allow you to edit the sudoers file properly, and you can resume using sudo after this is solved.


I thought you wanted the error output i posted. sorry i think i get you now.

you want me to do that command. And show you what i have in my sudoers so you see what i did wrong to help me fix it
Title: Re: Need help sudoers file
Post by: shaggytwodope on February 17, 2016, 06:54:08 PM
Indeed, the two lines that provide the error message. If you can share them we can fix it.

In general for security or other reasons, error messages like that one do not provide much details. This can not be debugged without more detailed info in alot of cases. The pkexec command uses a different means to access the stuff sudo can be used for. But it's not a replacement in the future.  So keep that in mind.
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 07:13:14 PM
OK so i fixed it i think.

did sudo leafpad /etc/sudoers. this came up

I did however get this
Code: [Select]
(leafpad:3674): IBUS-WARNING **: The owner of /home/chicknfangz/.config/ibus/bus is not root!

Code: [Select]
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

I still can't go into root with su says su: Authentication failure
Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 07:17:34 PM
OK never mind

i did
Code: [Select]
sudo grub-mkconfig -o /boot/grub/grub.cfg

and it worked so i guess i don't need su. no point in going into root and messing stuff up  ;D

Title: Re: Need help sudoers file
Post by: chicknfangz on February 17, 2016, 07:20:40 PM
Thanks shaggytwodope & jerry & rokytnji  ;D
Title: Re: Need help sudoers file
Post by: rokytnji on February 17, 2016, 08:49:59 PM
Re read my post and you will see sudo -i is how I get root access in terminal in Linux Lite. Glad you got it sorted. I am busy with garage remodeling.
Hence why I am not on a computer during the day.