[opensuse] startx su/sudo
Hi! I have a Leap 42.2 machine with no display-manager running. On this machine I want to start a simple X11-session which brings up a single window as non-root user. As root, "/usr/bin/startx /usr/bin/xterm" works (so X is correctly configured) but I want xterm to be started as user. Reading the man pages I figured out that doing either /usr/bin/startx sudo -u thomas /usr/bin/xterm -- or /usr/bin/startx su thomas /usr/bin/xterm -- (the lines are started as root) should start xterm as user "thomas". However, both variants produce an error. The "su"-version produces the error "/usr/bin/xterm: /usr/bin/xterm: cannot execute binary file" The "sudo"-version" produces the error "/usr/bin/xterm: Xt error: Can't open display: \n/usr/bin/xterm: DISPLAY is not set" Anyone an idea how to start a simple X-program like xterm as user from a root-shell. best regards Thomas -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-11 17:23, Thomas Wagner wrote:
Hi!
I have a Leap 42.2 machine with no display-manager running. On this machine I want to start a simple X11-session which brings up a single window as non-root user. As root, "/usr/bin/startx /usr/bin/xterm" works (so X is correctly configured) but I want xterm to be started as user.
Why not directly run startx as that target user? -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))
On 2017-02-12 02:16, Carlos E. R. wrote:
On 2017-02-11 17:23, Thomas Wagner wrote:
I want to start a simple X11-session which brings up a single window as non-root user. As root, "/usr/bin/startx /usr/bin/xterm" works (so X is correctly configured) but I want xterm to be started as user.
Why not directly run startx as that target user? AFAIK startx is inteded to be started as root. Please correct me, if I'm wrong.
startx as user results in an error: Fatal server error: (EE) xf86OpenConsole: Cannot open virtual console 3 (Permission denied) best regards Thomas -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/02/17 11:28, Thomas Wagner wrote:
On 2017-02-12 02:16, Carlos E. R. wrote:
On 2017-02-11 17:23, Thomas Wagner wrote:
I want to start a simple X11-session which brings up a single window as non-root user. As root, "/usr/bin/startx /usr/bin/xterm" works (so X is correctly configured) but I want xterm to be started as user.
Why not directly run startx as that target user? AFAIK startx is inteded to be started as root. Please correct me, if I'm wrong.
startx shoudn't care.
startx as user results in an error: Fatal server error: (EE) xf86OpenConsole: Cannot open virtual console 3 (Permission denied)
I thought by default startx started at virtual console 7, so that feels weird to me. But it sounds like you have a permissions problem. On pretty much every system I've known, where X hasn't started automatically, I've had no problems running startx as the user I've logged in as. Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-12 12:28, Thomas Wagner wrote:
On 2017-02-12 02:16, Carlos E. R. wrote:
Why not directly run startx as that target user? AFAIK startx is inteded to be started as root. Please correct me, if I'm wrong.
startx as user results in an error: Fatal server error: (EE) xf86OpenConsole: Cannot open virtual console 3 (Permission denied)
So? Correct it. Hint: /etc/permissions.local -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))
On Sat, 11 Feb 2017 17:23:43 +0100 Thomas Wagner <wagner-thomas@gmx.at> wrote:
Hi!
I have a Leap 42.2 machine with no display-manager running. On this machine I want to start a simple X11-session which brings up a single window as non-root user. As root, "/usr/bin/startx /usr/bin/xterm" works (so X is correctly configured) but I want xterm to be started as user.
Reading the man pages I figured out that doing either /usr/bin/startx sudo -u thomas /usr/bin/xterm -- or /usr/bin/startx su thomas /usr/bin/xterm -- (the lines are started as root) should start xterm as user "thomas".
However, both variants produce an error. The "su"-version produces the error "/usr/bin/xterm: /usr/bin/xterm: cannot execute binary file" The "sudo"-version" produces the error "/usr/bin/xterm: Xt error: Can't open display: \n/usr/bin/xterm: DISPLAY is not set"
How about setting the DISPLAY environment variable as part of the command sudo executes? Or using the -display argument to xterm? I suspect :0.0 will work as the display value.
Anyone an idea how to start a simple X-program like xterm as user from a root-shell.
best regards
Thomas
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-12 12:52, Dave Howorth wrote:
How about setting the DISPLAY environment variable as part of the command sudo executes? Or using the -display argument to xterm? I suspect :0.0 will work as the display value. Thanks for the hint, but it doens't change anything.
best regards Thomas -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 12 Feb 2017 13:56:52 +0100 Thomas Wagner <wagner-thomas@gmx.at> wrote:
On 2017-02-12 12:52, Dave Howorth wrote:
How about setting the DISPLAY environment variable as part of the command sudo executes? Or using the -display argument to xterm? I suspect :0.0 will work as the display value. Thanks for the hint, but it doens't change anything.
sudo -u a_user xterm -display :0.0 works for me, whilst sudo -u a_user xterm does not. If you provide a -display argument to xterm, I don't see how it would then report that the display is not set. Are you sure it reports exactly the same error? PS please don't copy me on your reply. I read the list. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Carlos E. R.
-
Dave Howorth
-
Thomas Wagner
-
Wols Lists