Error in locking authority file

When trying to connect using ssh, if you see a similar error to the following in the status log

/usr/X11R6/bin/xauth: error in locking authority file $HOME/.Xauthority

This issue typically occurs for one of several reasons

  • Out of disk space:  If your user has a disk quota, or your disk is full, the xauth program will not be able to write to the .Xauthority file.  Try freeing up disk space on your system
  • File permissions are wrong:  The file permissions on .Xauthority must be 400 (read and write for user ONLY).  Any other file permission will cause the xauth program to reject the file

As a final measure you can try deleting the .Xauthority file altogether.  The file will be recreated the next time you log in with ssh