Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Root required to connect to WiFi
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
axelbest
n00b
n00b


Joined: 30 Dec 2005
Posts: 44
Location: Toronto, Canada

PostPosted: Sun Sep 06, 2020 3:23 pm    Post subject: Root required to connect to WiFi Reply with quote

Hi, since the last update yesterday, KDE started to show a window from policikit KDE agent asking the root password to connect to WiFi every time the system turns on. How can allow all users to manage and connect to any network? This was not happening before the update.

Thank you in advance
Back to top
View user's profile Send private message
alamahant
l33t
l33t


Joined: 23 Mar 2019
Posts: 801

PostPosted: Sun Sep 06, 2020 6:01 pm    Post subject: Reply with quote

In
Code:

/etc/polkit-1/rules.d/50-default.rules

maybe add
Code:

polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});

Then maybe add your user to the wheel group
Code:

sudo usermod -aG wheel $USER

Please see this
[url]
https://wiki.gentoo.org/wiki/Polkit
[/url]
And run visudo and uncomment the line about "wheel" no passwd.

But maybe this is too many permissions.
Maybe run
pkaction
and try to fine if there is anything related to network or wifi.
Then modify your rules to pertain only to that...
BUT this should have been don by KDE.
Did you miss maybe a dispatch-conf?
:D
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 16648

PostPosted: Sun Sep 06, 2020 6:41 pm    Post subject: Reply with quote

alamahant wrote:
And run visudo and uncomment the line about "wheel" no passwd.
This will allow any user in the wheel group to run commands as root without a password. This is probably excessive for what OP wants, and in my opinion, should come with a warning like the one I wrote. Some people may not want their daily user to have unrestricted root access.
Back to top
View user's profile Send private message
axelbest
n00b
n00b


Joined: 30 Dec 2005
Posts: 44
Location: Toronto, Canada

PostPosted: Tue Sep 08, 2020 4:18 pm    Post subject: Reply with quote

Hu wrote:
alamahant wrote:
And run visudo and uncomment the line about "wheel" no passwd.
This will allow any user in the wheel group to run commands as root without a password. This is probably excessive for what OP wants, and in my opinion, should come with a warning like the one I wrote. Some people may not want their daily user to have unrestricted root access.


Agreed, I don't want allow all users to change no more then the network configuration

I tried creating the file /etc/polkit-1/rules.d/10-network.rules but didn't work. Is there any mistake here?

Code:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" &&
        subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});
Back to top
View user's profile Send private message
alamahant
l33t
l33t


Joined: 23 Mar 2019
Posts: 801

PostPosted: Tue Sep 08, 2020 4:37 pm    Post subject: Reply with quote

Being in the wheel group only means that a user can run
su -
It does not necessarily do this passwordless..
For that you need
user ALL=(ALL) NOPASSWD: ALL
Maybe you should modify your stanza to
Code:


polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" &&
        subject.user == "larry") {
        return polkit.Result.YES;
    }
});

Again
this should have been dealt with by your KDE.
I wonder why it wasnt.
Do you have USE="policykit"
in make.conf?
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8116
Location: Austria

PostPosted: Tue Sep 08, 2020 5:53 pm    Post subject: Reply with quote

Make sure your user has a proper logind session, no polkit hacks.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum