Here's a problem... You are running X-windows successfully as the user you logged on as but need to SU/SUDO to another user and still use the X?

No worries, this can be solved too!

As the user logging on using X11 forwarding:

> xauth nlist > /tmp/savexauth
> echo export DISPLAY=$DISPLAY > /tmp/savedisplay
> sudo /bin/su - [USER]

Then as the new user:

> xauth nmerge /tmp/savexauth
> . /tmp/savedisplay

A good practice is also to remove the files as any other user can "steal" your screen otherwise:

rm /tmp/savexauth
rm /tmp/savedisplay

Good luck!


Ok, so, you are logged on to a server and you made sure you followed the below steps:

1) Start a X-server on your host (like Xming

2) Enable X11 forwarding and setting the display number to match the one of the X-server in your SSH client prior to logging on


Page 2 of 2


Please consider supporting my efforts.


Please consider supporting my efforts.

Google Ads