LinuxQuestions.org
Visit Jeremy's Blog.
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-18-2017, 01:11 PM   #16
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled

Quote:
I am running Linux Mint 18.1 with Mate, but I don't know which version of Mate.
If it has something like mate-terminal you can type mate-terminal --version to check it.

Quote:
No, I haven't gotten that far yet. I want to search for other options before trying that.
It is not far, just one simple edit away :P
 
Old 06-18-2017, 01:14 PM   #17
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
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.



Exactly. PAM serves just as another layer, to prevent others from "guessing" your password.

Ok, maybe this is worth a shot. How do I use it? Do I just go into terminal as sudo and type what was written?
 
Old 06-18-2017, 01:18 PM   #18
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
No, you use sudo nano /etc/pam.d/su and then edit that file. there will be line that contains this:

Code:
# auth       required   pam_wheel.so
and you should edit it to look like described before. Do not forget to remove that comment #.
 
Old 06-18-2017, 01:24 PM   #19
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
No, you use sudo nano /etc/pam.d/su and then edit that file. there will be line that contains this:

Code:
# auth       required   pam_wheel.so
and you should edit it to look like described before. Do not forget to remove that comment #.
So I use sudo nano to make this:

# auth required pam_wheel.so

Look like that:

auth required pam_wheel.so group=sudo

Correct?

Is there anything special I should know about using "sudo nano", other than the standard caution applied while using sudo?
 
Old 06-18-2017, 01:29 PM   #20
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Quote:
So I use sudo nano to make this:

# auth required pam_wheel.so

Look like that:

auth required pam_wheel.so group=sudo

Correct?

Is there anything special I should know about using "sudo nano", other than the standard caution applied while using sudo?
Yes, like that and no, nothing special about sudo nano.
 
Old 06-18-2017, 01:48 PM   #21
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by MBA Whore View Post
I am running Linux Mint 18.1 with Mate, but I don't know which version of Mate.
Linux Mint 18 is based on Ubuntu 16.04, so you do have pkexec to deal with.

Try the instructions on the Ask Ubuntu link given above. Going that route, you'll have to add some file (ending in .pkla) in the directory /var/lib/polkit-1/localauthority/50-local.d/ to override some of the settings in /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

PAM can be used as a choke point, but it looks like your problem is coming from pkexec.
 
Old 06-18-2017, 01:55 PM   #22
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
Yes, like that and no, nothing special about sudo nano.
Ok, I successfully edited /etc/pam.d/su and saved it.

I restarted and went into my desktop (non-sudo) account.

I used the Synaptic GUI and it asked for my Administration Account password, which is the only sudo-enabled account I have. It still let me into Synaptic.

This is so frustrating.

Last edited by MBA Whore; 06-18-2017 at 01:58 PM. Reason: misspelling
 
Old 06-18-2017, 01:57 PM   #23
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
Linux Mint 18 is based on Ubuntu 16.04, so you do have pkexec to deal with.

Try the instructions on the Ask Ubuntu link given above. Going that route, you'll have to add some file (ending in .pkla) in the directory /var/lib/polkit-1/localauthority/50-local.d/ to override some of the settings in /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

PAM can be used as a choke point, but it looks like your problem is coming from pkexec.
Wow, now I am beginning to remember why I left Linux several years ago. This should be easier for noobs like myself.

Does Debian or any other distro have this pkexec issue?
 
Old 06-18-2017, 02:05 PM   #24
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
I ran this command: sudo -l

on my supposedly non-sudo, regular desktop user account and this is the output:


catoffline@CATLAP ~ $ sudo -l
Matching Defaults entries for catoffline on CATLAP:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User catoffline may run the following commands on CATLAP:
(root) NOPASSWD: /usr/lib/linuxmint/mintUpdate/checkAPT.py
catoffline@CATLAP ~ $


Does anyone know what that means?
 
Old 06-18-2017, 02:16 PM   #25
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Quote:
I ran this command: sudo -l

on my supposedly non-sudo, regular desktop user account and this is the output:


catoffline@CATLAP ~ $ sudo -l
Matching Defaults entries for catoffline on CATLAP:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User catoffline may run the following commands on CATLAP:
(root) NOPASSWD: /usr/lib/linuxmint/mintUpdate/checkAPT.py
catoffline@CATLAP ~ $


Does anyone know what that means?
It just gives you commands that your user may run. Run it with your privileged user and you will see difference.
 
Old 06-18-2017, 02:31 PM   #26
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
dejank, and anyone else:

All I want is for only my sudo account to be able to make system changes. I don't want any other user to be able to "SU" or "SUDO" whether it is via command line or GUI.

Regarding the # (comment) in nano, what is the difference between leaving # and removing #?

The nano page has different things written regarding # which make it confusing. I don't understand it.

What is the difference between:

1) auth required pam_wheel.so group=sudo

2) # auth required pam_wheel.so group=sudo
 
Old 06-18-2017, 02:33 PM   #27
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
It just gives you commands that your user may run. Run it with your privileged user and you will see difference.
dejank -

Yes, thank you but what I mean specifically is this line:

"(root) NOPASSWD: /usr/lib/linuxmint/mintUpdate/checkAPT.py"

Does that line mean the account has root access? How could that be if it is only a desktop user account?
 
Old 06-18-2017, 02:58 PM   #28
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
No, it does not mean that. All it means is that that specific command can be used by unprivileged user. And in your case, it simply means that mint package manager will check for updates. He can not install new packages, nor change system in any way except in what is allowed to him by default. Linux by it's nature is very secure and restrictive in what unprivileged users can, or can not do. Policy kit agent ( that pkexec thingy is just part of it ) is way to give unprivileged users some things that you can expect that every user on desktop/laptop should be able to do. Like, for example, logging into wifi network, automatically mounting usb/dvd... While that thing you encounter with synaptic may seem annoying, it is ok as long as other users do not have your password. And there is way to turn it off, though I do not have time now to bother with it. Would require lots of time investment in learning to write and edit various policy kit files. But it is on my very long to do list :P

However, if you would like to spend some time to learn more about polkit, there is good read about it here: https://wiki.archlinux.org/index.php/Polkit

Last edited by dejank; 06-18-2017 at 03:46 PM.
 
Old 06-18-2017, 06:41 PM   #29
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,342

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by MBA Whore View Post
How do I know if I have pkexec
open a terminal and enter:

which pkexec

-------------------
Steve Stites
 
Old 06-19-2017, 12:54 AM   #30
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by dejank View Post
Policy kit agent ( that pkexec thingy is just part of it ) is way to give unprivileged users some things that you can expect that every user on desktop/laptop should be able to do. Like, for example, logging into wifi network, automatically mounting usb/dvd...
Which can all be managed in a simpler, clearer manner using sudo. The syntax for sudoers is just EBNF and easy to learn if not already familiar.

PolicyKit apparently comes out of Red Hat and because of that and its other symptoms I wonder how many of its developers have ties to systemd. Regardless, PolicyKit is overly complex and that combined with its origins suggest that Red Hat is using it to make Linux so difficult as to take it out of the hands of anyone except full-time, Red Hat-trained, professionals.

One of their top executives made a statemet about complexity being a sales tactic. This looks like them making good on that threat.

Quote:
Originally Posted by dejank View Post
While that thing you encounter with synaptic may seem annoying, it is ok as long as other users do not have your password. And there is way to turn it off, though I do not have time now to bother with it. Would require lots of time investment in learning to write and edit various policy kit files.
Yes, again, PolicyKit appears to be about making Linux complicated and hard to use.

HMBA Whore : however, between the Arch documentation and the pointer to the directory and one of the PolicyKit configuration files mentioned earlier you should be able to find the lines to change to remove the prompt the other users are getting. But keep in mind there is no "sudo password" just accounts that are authorized by PolicyKit (pkexec) to do an end-run around your settings.
 
  


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 02:58 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