Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k
Source Link
Astora
  • 519
  • 1
  • 6
  • 20

About Xauth and DISPLAY variable

I'd like to understand about xauth and DISPLAY variable and how ssh -X auto-generate the DISPLAY variable and why it choose those values? I've seen is somewhere that is not correct to set DISPLAY manually as well.

what mean each column of this output?

[root@serverdg ~]# xauth list
serverdg2/unix:11  MIT-MAGIC-COOKIE-1  87b515cf92e356b7702d3afd721f7fe1
serverdg2/unix:10  MIT-MAGIC-COOKIE-1  e8f9bfb5abac8757f4864656ce4f9bd1
serverdg/unix:12  MIT-MAGIC-COOKIE-1  7270008abd9f949a9b1af76c7742da9e
serverdg/unix:11  MIT-MAGIC-COOKIE-1  bb2f1768b445f372e5975d728579517e
serverdg/unix:10  MIT-MAGIC-COOKIE-1  475b9a6cbc7567b956511d5d2d27950b

Why ssh -X generate a value for DISPLAY variable with 10.0 like in this example?

[root@serverdg ~]# echo $DISPLAY
localhost:10.0

Everything I know is that I need to copy those values of xauth list and DISPLAY if I change my current user user to another user (su - user) to be able to use the X because this values are generate when is made a new login with ssh.