ubuntu and privilege elevation in i3wm

10

5

I use i3wm (www.i3wm.org) as the window manager for ubuntu 11.10 x64.

it seems that whatever piece of magic that controls elevation is not functioning properly. It's not an issue with i3wm perse, but rather something provided by gnome and unity that im missing, and need to implement manually.

example:

in unity, if i run software center, i am prompted for my admin password, and everything works as expected. in i3wm, running software center does not prompt, and thus i cant install anything. (unless i do sudo software-center from the CLI)

is there some process / application i should be using to have apps ask for admin passwords when required?

it'd be great to get that bit of functionality in i3.

adam

Posted 2012-02-13T16:29:34.677

Reputation: 473

Is this still unanswered? – mloskot – 2012-06-08T09:23:57.443

Answers

9

Elevation uses several components:

  • the program must be running in a ConsoleKit or systemd-logind session – ideally, all of your X11 programs should be in the same session.

    If your distribution uses systemd, run loginctl show-session "$XDG_SESSION_ID" and look for "State=active".

    Otherwise, run ck-list-sessions and verify that it shows your X11 session as both "local = TRUE" and "active = TRUE".

  • the session must have a PolicyKit agent – this is the piece of software that displays elevation prompts.

    Run /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 and see if it helps.

To test elevation, you can use pkexec /bin/sh or pkaction.

user1686

Posted 2012-02-13T16:29:34.677

Reputation: 283 655

:) adam@wtfhax:~$ /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1

(polkit-gnome-authentication-agent-1:9795): polkit-gnome-1-WARNING **: Failed to register client: The name org.gnome.SessionManager was not provided by any .service files – adam – 2012-02-13T17:00:04.067

ah, that works just fine actually. i tried doing some administrative stuff while that command was running, and was prompted as expected. adding /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 to my xinitrc solved the problem permanently :) thank you! – adam – 2012-02-13T17:52:01.767

@adam: Be careful with adding stuff to xinitrc like that. It is best when all programs run inside the same CK session, including the agents. – user1686 – 2012-02-13T18:02:26.443

3i actually thought about that, and added it to the .i3/config file, and had it run at login. – adam – 2012-02-13T20:56:57.277

1

AFAIK, privilege elevation has nothing to do with the window manager. Use gksudo for GUI apps that require root privileges.

For example:

gksudo synaptic &

m0skit0

Posted 2012-02-13T16:29:34.677

Reputation: 1 317

that much makes sense, but i3wm has a nice launcher (mod+d) that i use to fire up software, and afaik, i cant modify it to call things in such a way. – adam – 2012-02-13T16:57:38.733

I highly doubt you can't modify it, specially if it's open source. And if you can't modify how software is launched, it's horrible. Even Windows allows that... – m0skit0 – 2012-02-13T18:57:09.300

3@adam mod+d and then type in gksudo synaptic hit ENTER and you'll be prompted for password. All works like charm. – mloskot – 2013-03-13T23:49:25.720