Additional Blogs by Members
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

Some times we haven't access with root user directly to a server and we need execute su - to scale up to root. When we do we lose X connection but we can perform the following steps to run applications XWindow:

1.- Connect to server and list enviroment variables and xauth

Connecting to

Connection established.

To escape to local shell, press 'Ctrl+Alt+]'.

Last login: Mon May 23 11:22:22 2016 from

johnd@JohnD-Server1:~> echo $DISPLAY


johnd@JohnD-Server1:~> xauth list $DISPLAY

JohnD-Server1/unix:10  MIT-MAGIC-COOKIE-1  70a56a2cb6e8d74cfefc29c1b6186efb

2.- Change to root user:

johnd@JohnD-Server1:~> sudo su -

3.- Set the variable and xauth

JohnD-Server1:~ # export DISPLAY=localhost:10.0

JohnD-Server1:~ # xauth add JohnD-Server1/unix:10 MIT-MAGIC-COOKIE-1 70a56a2cb6e8d74cfefc29c1b6186efb

Enjoy it

Juan de la Cruz Arellano Royo