.Xauthority file is empty
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.
Prasanna
Updated on September 18, 2022Comments
-
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 usingsudo 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 almost 10 yearsWhat does
echo $XAUTHORITY
give? -
Admin almost 10 years@celtschk That is not set. It gives me nothing.
-
Admin almost 10 yearsIs
X11Forwarding
enabled in/etc/ssh/sshd_config
on the cluster? Also, isUseLogin
set tono
? (According to sshd_config(5), enablingUseLogin
disablesX11Forwarding
) -
Admin almost 10 years@celtschk Yes. X11Forwarding is set to "yes" and UseLogin is set to "no"
-
Admin almost 10 yearsUppercase "Yes" or lowercase "yes"? It should be the latter.
-
Admin almost 10 yearsYes it's in lowercase. I corrected my typo in the comment
-
Admin almost 10 yearsIs
xauth
in/usr/bin/
? If not, is there anXAuthLocation
insshd_config
giving its correct location? Also: Did you try using the-v
option ofssh
to get more information about what might go wrong? -
Admin almost 10 yearsYes, xauth is present in /usr/bin/. And I have edited my question including -v option.
-
Admin almost 10 yearsCan you start X11 applications locally from the terminal you're running ssh from?
-
Admin almost 10 yearsCluster 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 almost 10 yearsI mean the local window where you type the ssh command to log into the remote server.
-