Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In batch scripts I often log in to the same system through ssh multiple times. E.g.

seq 1000 | parallel -j0 -S server echo

This triggers a race condition giving the error:

/usr/bin/xauth:  error in locking authority file /home/user/.Xauthority

How can I avoid this?

share|improve this question
up vote 6 down vote accepted

Try to not forward X when you log in with ssh. You shouldn't really need it, do you?

If you do not want to take out ForwardX11 true from your ~/.ssh/config (I am guessing that's where it got set), you can try adding -x to the command line.

seq 1000 | parallel -j0 -S server -x echo
share|improve this answer

You could disable X-forwarding in your SSH config for this server.

For instance in your $HOME/.ssh/config you could have

  Host server
             ForwardX11 no
share|improve this answer

Your Answer


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.