.Xauthority file is empty

9,243

If the filesystem containing your home directory on the remote server is 100% full or if disk quotas are in effect and you're over your quota, it might be possible to create a new zero-length file but not to write anything into it. This will stop sshd from being able to write a X11 session cookie into the .Xauthority file, causing the X11 forwarding to fail.

Check for these conditions, with commands df -h . and quota, before trying anything more elaborate. If necessary, clear some space, then log out and try again.

Share:
9,243
Prasanna
Author by

Prasanna

Updated on September 18, 2022

Comments

  • Prasanna
    Prasanna over 1 year

    I have been trying to ssh -X to my cluster running OpenSUSE 11.2. It used to work well for me. But now I get this message:

    X11 connection rejected because of wrong authentication.
    Failed to open the X11 display!
    

    So I tried to check the ownership and permission of the .Xauthority file using

    sudo ls -al .Xauthority
    

    and I get to see that the file is empty with size 0:

    -rw------- 1 <my-user-name> users 0 2014-07-31 10:03 .Xauthority
    

    When I log in with ssh -Xv

    I get the following when i try to open xlock

    debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
    debug1: client_request_x11: request from ::1 53267
    debug1: channel 1: new [x11]
    debug1: confirm x11
    X11 connection rejected because of wrong authentication.
    debug1: channel 1: free: x11, nchannels 2
    Error: Can't open display: localhost:10.0
    

    How would I fix this?

    • Admin
      Admin almost 10 years
      What does echo $XAUTHORITY give?
    • Admin
      Admin almost 10 years
      @celtschk That is not set. It gives me nothing.
    • Admin
      Admin almost 10 years
      Is X11Forwarding enabled in /etc/ssh/sshd_config on the cluster? Also, is UseLogin set to no? (According to sshd_config(5), enabling UseLogin disables X11Forwarding)
    • Admin
      Admin almost 10 years
      @celtschk Yes. X11Forwarding is set to "yes" and UseLogin is set to "no"
    • Admin
      Admin almost 10 years
      Uppercase "Yes" or lowercase "yes"? It should be the latter.
    • Admin
      Admin almost 10 years
      Yes it's in lowercase. I corrected my typo in the comment
    • Admin
      Admin almost 10 years
      Is xauth in /usr/bin/? If not, is there an XAuthLocation in sshd_config giving its correct location? Also: Did you try using the -v option of ssh to get more information about what might go wrong?
    • Admin
      Admin almost 10 years
      Yes, xauth is present in /usr/bin/. And I have edited my question including -v option.
    • Admin
      Admin almost 10 years
      Can you start X11 applications locally from the terminal you're running ssh from?
    • Admin
      Admin almost 10 years
      Cluster is present at a remote location for which I need some authorized personnel. Will it make a difference? If so i can request them to try.
    • Admin
      Admin almost 10 years
      I mean the local window where you type the ssh command to log into the remote server.