You are not logged in.

#1 2020-04-21 10:21:14

light9876
Member
Registered: 2020-01-05
Posts: 142

[SOLVED] Force require root password when installing apps from pamac

I would like the root passowrd to be required whenever a user tries to install apps.

Currently when the user tries installing apps either through

sudo pacman -S <package>

Or by using the pacman GUI, only the user password is required.

I tried uncommenting this line:

Defaults targetpw

In the file:

/etc/sudoers

This worked when using the sudo command. But when using the GUI, the user is asked for his own password, not the root password. Any ideas please?

Last edited by light9876 (2020-04-27 10:34:30)

Offline

#2 2020-04-21 10:40:31

ajayyadav2412
Member
Registered: 2020-04-21
Posts: 11

Re: [SOLVED] Force require root password when installing apps from pamac

If you want to use root password you need to be logged in as root. If you use other account that root then that account should not be having sudo permissions

Offline

#3 2020-04-21 10:41:26

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Force require root password when installing apps from pamac

Pacman doesn't have a GUI.

How did you install Arch?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2020-04-21 11:36:03

light9876
Member
Registered: 2020-01-05
Posts: 142

Re: [SOLVED] Force require root password when installing apps from pamac

I installed Arch from the installer here https://www.archlinux.org/download/

I'm sorry I meant pamac-manager; not pacman.

Then how can I restrict user from installing applications using pamac-manager? Is uninstalling it the only option?

EDIT:
Running the command

pacman -S vlc

From command line does not work, it does not even ask for the user's password. But installing vlc from pamac-manager, asks for the user's password.

Last edited by light9876 (2020-04-21 11:39:23)

Offline

#5 2020-04-21 11:40:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,094

Re: [SOLVED] Force require root password when installing apps from pamac

Pamac likely has defined polkit rules, or rather utilizes the default polkit rule to allow all users of the wheel group to access privileged actions: https://wiki.archlinux.org/index.php/Polkit that entire page should be read if interested in the topic but specifically pay attention to: https://wiki.archlinux.org/index.php/Po … identities as it explains how to change this exact behaviour you are asking about.

Last edited by V1del (2020-04-21 11:41:10)

Offline

#6 2020-04-21 12:55:21

light9876
Member
Registered: 2020-01-05
Posts: 142

Re: [SOLVED] Force require root password when installing apps from pamac

Thank you so much V1del, it worked.

I only added the file:

/etc/polkit-1/rules.d/49-rootpw_global.rules

Containing:

/* Always authenticate Admins by prompting for the root
 * password, similar to the rootpw option in sudo
 */
polkit.addAdminRule(function(action, subject) {
    return ["unix-user:root"];
});

Last edited by light9876 (2020-04-21 12:55:36)

Offline

#7 2020-04-21 13:06:09

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Force require root password when installing apps from pamac

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

#8 2020-04-21 13:47:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Force require root password when installing apps from pamac

I'm a bit confused by - and concerned about - the goal.

You apparently have users that are in the wheel group (or otherwise allowed to use sudo) but you don't want them to be able to install packages.  Limiting pacman and pamac to only accepting the root password will not acheive this goal.  If users are in the wheel group and/or can use sudo, they can simply change the root password then install whatever they want.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2020-04-21 14:06:31

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Re: [SOLVED] Force require root password when installing apps from pamac

They can also just launch a su shell ;-)

However, he already contained sudo by enabling targetpw and "pkexec bash" gets me https://xkcd.com/838/

Offline

#10 2020-04-21 14:31:06

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,386
Website

Re: [SOLVED] Force require root password when installing apps from pamac

It makes me sad that Randall runs 'sudo su' instead of 'sudo -i'. sad


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#11 2020-04-21 14:57:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Re: [SOLVED] Force require root password when installing apps from pamac

According to https://www.explainxkcd.com/wiki/index.php/Rob that's Black Hats roommate, so he's probably deliberately side-stepping some prank…

Offline

#12 2020-04-22 16:53:05

SurlyCycler
Member
Registered: 2019-10-26
Posts: 47

Re: [SOLVED] Force require root password when installing apps from pamac

oops never mind LOL

Last edited by SurlyCycler (2020-04-22 17:20:12)

Offline

#13 2020-04-22 19:04:37

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Force require root password when installing apps from pamac

WorMzy wrote:

It makes me sad that Randall runs 'sudo su' instead of 'sudo -i'. sad

Those two commands do have different behavior though, for example the results of `env`, sudo -i performs a login as root vs. just spawning a shell with a different EUID (sudo bash would be more comparable, and sudo -i is closer to sudo su --login which would incidentally wipe $SUDO_*).


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB