How to pass X11 display rights to "su"

July 27th, 2016

1. Log in to the system, issue the following commands and save their output for further reference

echo "$DISPLAY" xauth listYou will see something similar to this:

% echo $DISPLAY localhost:10.0
% xauth list
ubuntu/unix:12 MIT-MAGIC-COOKIE-1 9e7f2b822e5c1cdd96d048adfb870519
ubuntu/unix:11 MIT-MAGIC-COOKIE-1 1eaf535afee8b2de2f0ab9bcab7ef149
ubuntu/unix:10 MIT-MAGIC-COOKIE-1 3bd9602df5fe354c19e39f211ee4668b

Note the value after the semicolon in the DISPLAY value (10 in this case, in red), note that the last entry is the cookie you're interested in (also in red).

2. Switch the user (su ...), and run the following commands:

% su -
Password:
~# export DISPLAY=localhost:10.0 # this is the previously saved DISPLAY value
~# xauth add ubuntu/unix:10 MIT-MAGIC-COOKIE-1 3bd9602df5fe354c19e39f211ee4668b # this is the last entry from xauth list output

After this your X session should work.

Add a prefix string to beginning of each line

July 27th, 2016

Various ways to add a prefix to every line in a file.

M1 Basic Training

July 27th, 2016

Webinar for the Elk-M1 alarm system.

Installing Recessed sensors in doors and windows

July 27th, 2016

Nice recommendations for installing alarm sensors.

Installing fun plug (FFP) on D-Link DNS 320, 323, 325, 323, 343 and 345

July 27th, 2016

Good instructions on installing fun plug to extend the D-Link NAS devices.