Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 137648  / 3 Years ago, mon, september 6, 2021, 2:50:42

I defined 2 user accounts:




  • one with admin privilege (with sudo right) => lets call it adminuser.

  • a 2nd one without any privilege => lets call it normaluser

    and I configure the autologin on this 2nd user normaluser.




So when I open a normaluser session and want to run an application with admin privilege,

I open a terminal Ctrl+Alt+T and:



su adminuser
sudo anyapplication ...


It works fine, without having to quit the normaluser session (no need to open a adminuser session).






But what should I do if the application needs to run with a GUI (Graphic User Interface) ?

I though about that:



su adminuser
gksu anyapplication ...


but I get



** (gksu:9122): WARNING **: the connexion is closed
No protocol specified
No protocol specified
(gksu:9122): Gtk-WARNING **: cannot open display: :0.0

More From » sudo

 Answers
7

PAM can take care of it



This works for me on Ubuntu 16.04 (edit: it works too on 18.04 LTS):



put the line:



session optional pam_xauth.so


somewhere in:



/etc/pam.d/su


and/or



/etc/pam.d/sudo


and then doing "su -" or "sudo su -" I can use graphical apps as root.


[#36786] Tuesday, September 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
izeeas

Total Points: 412
Total Questions: 105
Total Answers: 118

Location: Trinidad and Tobago
Member since Fri, May 8, 2020
4 Years ago
;