Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I su(1) to another user and run an X application?

application run user
0
Posted

How do I su(1) to another user and run an X application?

0

You need to set your $DISPLAY and allow others to use your console. If you don’t, you get a message like “Can’t open display”. By default, only the user who logged in on console can connect to the display. To allow another user to connect there are two ways – one easy and one secure (unfortunately, you can’t have both): Easy: As user logged in on console run “xhost +LOCAL:” (This gives permission to connect to the display to anyone logged in on the machine—this includes being able to open windows, read your keystrokes, send keystrokes, etc. Obviously not a good idea if you have other users on the system you don’t trust completely.) Starting with Solaris 10, you can also use this safer, more-restrictive format: xhost xhost +si:localuser:username For example: xhost +si:localuser:root As any other user logged in on the box, run “setenv DISPLAY :0” or “DISPLAY=:0; export DISPLAY”, depending on your shell type.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123