title: where to change the default location of .Xauthority file when log in via ssh -X as a specific user
body: <p>I need to <strong>change the <code>.Xauthority</code> file location</strong> for a group of users to be <code>$HOME/tmp/.Xauthority</code> rather than the default <code>$HOME/.Xauthority</code>.</p>
  
  <p>I already tried what I could catch up from several sources like:</p>
  
  <p>I set the environment variable like this in several <code>/etc/.profile</code>, <code>.profile</code>, <code>.bashrc</code> .... etc. with the following: <code>XAUTHORITY=$HOME/tmp/.Xauthority</code></p>
  
  <p>With the result of:</p>
  
  <p>Any login attempt with a user of sshx group (<code>ssh -X server</code>) results in timeout in locking <code>$HOME/.Xauthority</code>. It is like having changed nothing. Interesting about is that if I <code>echo $XAUTHORITY</code> it shows <code>$HOME/tmp/.Xauthority</code>. <code>authx</code> is working as well, but not at the time of login. </p>
  
  <p>Therefore the processing I need must happen somewhere before <code>ssh -X</code> or while establishing the X connection. Where do I have to change it so that I can address a group of users only since I do not want root or users without a sshX group be affected since they eventually do not have the directory?</p>