over ssh -

$xclock
$sudo su -

#xclock
X11 connection rejected because of wrong authentication.

so I do -

$xauth list /*copy the lines*/ 
$sudo su -
#xauth add /*paste the lines*/
#xclock /* works */

I am fed up doing this on every login, how can I persist it?

link|improve this question

33% accept rate
feedback

1 Answer

  1. Don't run X11 software as root. Seriously.

  2. Use sudo -s or sudo -i instead of sudo su.

  3. Add XAUTHORITY to sudo's env_keep configuration option. It should point to an Xauthority file in your home directory.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.