LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 06-14-2017, 07:21 PM   #1
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Rep: Reputation: 30
Smile Restricting sudo / su to only 1 account


I have 3 accounts:

1) The 1st account is the only one in the sudo group
2) The 2nd account is a limited desktop user
3) The 3rd account is like #2

When accounts 2 or 3 are in use, one can click on something requiring root level privilege and get a prompt asking for the password of the 1st account, who is my only sudo member. Is it possible to stop that?

For example, pretend someone is in the 2nd account and clicks on Synaptic. That person would then have a prompt asking for the password of the 1st account, which is the sudo (Administrator) account. I don't want the 2nd and 3rd accounts on this system to even have the ability to input the sudo password, even if it is known.

Is it possible to create this restriction? If yes, then how?

Basically, I only want the 1st account to be able gain elevated privilege. I don't want the 2nd and 3rd accounts able to gain elevated privilege, even if those users know the proper password.

Thank you.
 
Old 06-14-2017, 09:09 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,341
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Other users should not have access to your password. That is a basic security practice. There should be no "even if it is known." It should not be known.

The first thing to do is to change the password for account number 1, the one with legitimate sudo privileges, and not reveal it to accounts 2 and 3. If the sudoers file is configured properly, that should take care of this issue.
 
Old 06-15-2017, 03:01 AM   #3
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
You can use config in /etc/pam.d/su:

Code:
auth required pam_wheel.so group=sudo
With that set, even if they know your password, they can not log in as another user if they are not member of the sudo group. So, they will probably not be able to do anything even if they guess your password.

Quote:
Other users should not have access to your password. That is a basic security practice. There should be no "even if it is known." It should not be known.
Exactly. PAM serves just as another layer, to prevent others from "guessing" your password.

Last edited by dejank; 06-15-2017 at 03:41 AM.
 
Old 06-15-2017, 12:45 PM   #4
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Thank you for the replies.

Let me clarify. Currently I am the only person using this system even though it has 3 accounts (administrator plus 2 regular users).

In the future, I would not expect any regular user to know my Administration (sudo) password. However, I noticed that the system asked for the Administration (sudo) password while I was testing the 2 regular user accounts. Those 2 regular user accounts are not in the sudo group. Only my 1st account (Administrator) is in the sudo group.

Are you folks saying that even if a regular user account gets an "Enter password for XYZ" message (Where XYZ is my only sudo group member) that the system would not accept the password, even if it is correct, because that regular user is not a sudo group member?
 
Old 06-16-2017, 02:03 AM   #5
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Well, there is simple way of testing it, right?
 
Old 06-16-2017, 10:02 AM   #6
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
HaHa - Yes, good point.
 
Old 06-16-2017, 10:07 AM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Also on some distros you may have pkexec muddying the water instead of normal sudo.
 
Old 06-16-2017, 11:21 PM   #8
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Turbocapitalist View Post
Also on some distros you may have pkexec muddying the water instead of normal sudo.
I never heard of pkexec. What is it?
 
Old 06-16-2017, 11:46 PM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Quote:
Originally Posted by MBA Whore View Post
I never heard of pkexec. What is it?
It's a shoddy mess that on the surface aims to provide a similar functionality as sudo, minus the flexibility and granularity. pkexec has no redeeming features as far as I can tell. It's rather lacking in all areas. I have no qualms about people trying new things or even revisiting old things in new ways, but I am adamant that they ought be a clear improvement before inclusion in a mainstream distro, but then the decision process these days seems bizarre to say the least.

Anyway, it's just a heads up that if your DE is ignoring your sudoers file, then you might have uncovered a pkexec backdoor. I haven't looked into how to disable it. The configuration documentation shows a convoluted disorganized tangle.
 
Old 06-18-2017, 11:45 AM   #10
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dejank View Post
Well, there is simple way of testing it, right?
Oh wow. I tested the sudo password on a non suso account to access Synaptic and it let me right insider!

Not good.

This must be a bug. I very clearly established only 1 sudo.

Would it be a Linux Mint bug or a Mate bug?

I am using Mint 18.1.
 
Old 06-18-2017, 11:55 AM   #11
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Not sure, do not use Mint Mate. But feel free to report it here: https://bugs.launchpad.net/linuxmint. Also, did you try to set /etc/pam.d/su as suggested?
 
Old 06-18-2017, 12:24 PM   #12
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Quote:
Originally Posted by MBA Whore View Post
Oh wow. I tested the sudo password on
sudo is just a tool. The password is tied to an account. Which distro is this on? It might be afflicted with pkexec.

Last edited by Turbocapitalist; 06-18-2017 at 12:28 PM.
 
Old 06-18-2017, 01:03 PM   #13
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Turbocapitalist View Post
sudo is just a tool. The password is tied to an account. Which distro is this on? It might be afflicted with pkexec.
I am running Linux Mint 18.1 with Mate, but I don't know which version of Mate.
 
Old 06-18-2017, 01:04 PM   #14
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dejank View Post
Not sure, do not use Mint Mate. But feel free to report it here: https://bugs.launchpad.net/linuxmint. Also, did you try to set /etc/pam.d/su as suggested?
No, I haven't gotten that far yet. I want to search for other options before trying that.
 
Old 06-18-2017, 01:11 PM   #15
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Turbocapitalist View Post
sudo is just a tool. The password is tied to an account. Which distro is this on? It might be afflicted with pkexec.
How do I know if I have pkexec and if it is causing that problem?
 
  


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] Restricting shell commands for sudo jlinkels Linux - Security 2 05-01-2012 01:18 PM
howto log usage of shared account (root account) after `sudo su -` drManhattan Linux - Server 5 09-30-2011 07:48 AM
Restricting Sudo Access carlosinfl Linux - Security 2 08-11-2011 04:48 PM
Can't use sudo, only account that's not root is not a sudo'ers [Ubuntu 9.10] randyriver10 Linux - Desktop 1 01-09-2010 07:56 PM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 10:04 PM.

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