demon121
Posts: 1
Joined: Wed Sep 11, 2013 1:13 pm

Default sudoers file?

Wed Sep 11, 2013 1:16 pm

I accidentally overwrote my sudoers file with just "". I know how to put the needed lines back but what are they ? I've searched all over and although people put how to edit the sudoers file, no one lists what the default should be ?

Could someone please give me a copy, thank you!

bfinio
Posts: 38
Joined: Mon Oct 14, 2013 8:53 pm

Re: Default sudoers file?

Mon Feb 10, 2014 8:24 pm

So, this looks like an old post, but I have the same problem - I screwed up my sudoers file somehow (long story), and I have no idea what the original should look like! Luckily I have multiple SD cards and I'm installing a fresh version of Raspbian on a backup. It would be nice if I could just find the text online somewhere though. Once I complete the Raspbian reinstall I'll post the original text here in the hopes of helping other people in the future (this post came up 2nd in google results for "raspberry pi default sudoers file").

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Default sudoers file?

Mon Feb 10, 2014 8:30 pm

Code: Select all

#
# 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

# 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
pi ALL=(ALL) NOPASSWD: ALL
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

bfinio
Posts: 38
Joined: Mon Oct 14, 2013 8:53 pm

Re: Default sudoers file?

Mon Feb 10, 2014 9:41 pm

Thanks!

JamesTheDev
Posts: 2
Joined: Sat Jun 25, 2016 7:02 pm

Re: Default sudoers file?

Sat Jun 25, 2016 7:04 pm

Hey,

Is the location of the sudoers file /etc/sudoers? Or is it somewhere else? Thanks in advance.

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: Default sudoers file?

Sat Jun 25, 2016 7:24 pm

Yes, the file is in '/etc/sudoers' but there may be other files in '/etc/sudoers.d/*` that are being used.
Account Inactive

JamesTheDev
Posts: 2
Joined: Sat Jun 25, 2016 7:02 pm

Re: Default sudoers file?

Sat Jun 25, 2016 8:28 pm

Thank you very much! I was just wondering how to edit the file without using "visudo". Have a great day!

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: Default sudoers file?

Sat Jun 25, 2016 8:34 pm

JamesTheDev wrote:Thank you very much! I was just wondering how to edit the file without using "visudo". Have a great day!
Use visudo, there's built in checks with that process so you don't end up fubar'ing your system.
Account Inactive

Return to “Raspberry Pi OS”