LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-27-2012, 08:52 AM   #1
lghizoni
Member
 
Registered: Dec 2011
Location: Denmark
Distribution: Slackware, Debian
Posts: 102

Rep: Reputation: Disabled
Exclude user from the sudoers


Hello all,

I'm a LinuxMint user, which by default lets the user with all privileges. I would like exclude any user from the sudoers file, and let only root with those privileges, like it happens in Debian. The problem is that I don't know how to do it properly.
I've already asked this in the LinuxMint forum, but had no answer. Could someone help me??

Below follows my sudoers file:

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


Thanks a lot!
 
Old 09-27-2012, 08:57 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
You'd have to use visudo, for best results...there is a page on this as well...oh, you'd like this thread on sudo as well...
And, yes, Mint does that...but, on the up side, the installation is a breeze and it's a pleasant OS to use. Just got it on my tablet and I lover it...no tough yet (the word being YET ) but...we'll get there...

Thor
 
Old 09-27-2012, 11:15 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
At first, you have to activate the root account with
Code:
sudo passwd root
So that you can log in as root. Test that the login works before proceeding.
Now you can either comment out the rows starting with %admin and %sudo in the sudoers file (use visudo for that), simply with putting a # in front of the line, or you remove all users from the admin and sudo group.
 
1 members found this post helpful.
Old 09-27-2012, 09:13 PM   #4
lghizoni
Member
 
Registered: Dec 2011
Location: Denmark
Distribution: Slackware, Debian
Posts: 102

Original Poster
Rep: Reputation: Disabled
It worked!!!

Thank you very much!!!

Now when I type sudo su it says that the user doesn't belong to the sudoers file. That's exactly what I wanted!!

Cheers!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] User not in sudoers: How to add user? Permtion Denied for sudoers file esgol Linux - Newbie 3 07-13-2012 07:44 AM
[SOLVED] User is not in the sudoers file khinch Debian 5 03-28-2012 12:27 PM
add user to sudoers zimbot Linux - General 3 12-15-2011 08:36 AM
'user' not in the sudoers file thomas2004ch Linux - Software 6 05-24-2011 10:20 AM
User not in the sudoers file ersek Linux - Newbie 10 06-09-2009 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration