8

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?

Ole Tange
  • 2,836
  • 5
  • 29
  • 45

2 Answers2

9

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
chutz
  • 7,569
  • 1
  • 28
  • 57
4

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
Dmitri Chubarov
  • 2,296
  • 1
  • 15
  • 28