Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

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.

share|improve this answer
    
sudo -s was what helped me. Thanks +1. –  enthusiasticgeek Dec 26 '13 at 16:34
1  
Can you provide a pointer why X11 shouldn't be run as root? –  Abdull Jan 19 at 1:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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