The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

automatic question for root

asked 2012-06-13 13:43:00 +0000

NobbZ gravatar image

Hi there!

From gnome, unity and kde I am used to have a pop up asking for roots credentials when starting an application that needs root (ie: Synaptic Package Management).

Is there something similar for i3? Or how can I use ksudo or gsudo (I think the tools have that names) in i3?

edit retag flag offensive close merge delete

Comments

Similar question asked here http://superuser.com/questions/389397/ubuntu-and-privilege-elevation-in-i3wm with solution based on ConsoleKit, though I haven't checked it. p.s. Please, spell question titles correctly with capital letters.

mloskot gravatar imagemloskot ( 2012-06-18 13:53:15 +0000 )edit

2 answers

Sort by ยป oldest newest most voted
5

answered 2012-06-14 10:43:29 +0000

joepd gravatar image

You are probably looking for gksudo. You just need to type 'gksudo synaptic,' in stead of 'synaptic'. And if you want to have this available under a key binding, put the command that works in your i3/config, or in another program launcher that you happen to use.

edit flag offensive delete link more
2

answered 2012-06-16 23:12:01 +0000

fernandotcl gravatar image

Note that desktop Linux is moving away from running X clients. A daemon (such as udisks) runs with privileged access. When a client (such as your graphical file manager) needs to perform an operation through this daemon (such as mounting a filesystem on a removable device), it asks the daemon to perform the action. The daemon will then check with PolicyKit if this is allowed. Depending on PolicyKit policies, an authentication agent will be invoked (perhaps prompting for credentials in the form of passwords or biometrics). If access is allowed, the daemon will perform the requested action.

All this stuff is done through D-Bus and D-Bus activation. This means you don't need to do anything other than installing an authentication agent. There are authentication agents for KDE and Gnome. Alternatively, add some local PolicyKit policies to allow access to the resources you need without requesting authorization through an agent.

Not all software supports PolicyKit, though. So basically, you have options:

  1. If the program you're planning to run as root supports PolicyKit, you can simply install a PolicyKit authentication agent and just launch the program with your regular account. You'll be prompted for authentication if needed.

  2. If the program you're planning to run as root supports PolicyKit, you can create a local policy so the requested privileged actions are always allowed for you. Then you can just launch the program with your regular account and access will be automatically granted.

  3. Use gksudo or similar programs by prefixing them with gksudo, as joepd described.

  4. Use password-less sudo.

I haven't yet experimented with option 1 yet, option 2 works fine here.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-06-13 13:43:00 +0000

Seen: 1,154 times

Last updated: Oct 08 '13