ssh -X remote does not work due to problem with xauth

FBUser freebsd at
Thu May 10 19:42:03 UTC 2018

Matthias Apitz <guru at> said (on 2018/05/10):
> I do thank for all replies, but have to say, that all ignored the provided 
> truss output (at least in all replies). Here it is again and shows that
> there is a LOCAL problem; the LOCAL /usr/local/bin/xauth tries to
> create the LOCAL file /tmp/ssh-adSkh4btDHWr/xauthfile (perhaps to move it over
> the SSH channel to the remote end) and it fails doing this:

To the contrary... 

>  2506: openat(AT_FDCWD,"/tmp/ssh-adSkh4btDHWr/xauthfile-c",O_WRONLY|O_CREAT|O_EXCL,0600) = 3 (0x3)

A different file was created.

>  2506: link("/tmp/ssh-adSkh4btDHWr/xauthfile-c","/tmp/ssh-adSkh4btDHWr/xauthfile-l") = 0 (0x0)

A link to that file was successfully created.

>  2506: access("/tmp/ssh-adSkh4btDHWr/xauthfile",F_OK) ERR#2 'No such file or directory'
>  2506: open("/tmp/ssh-adSkh4btDHWr/xauthfile",O_RDONLY,0666) ERR#2 'No such file or directory'
>  2506: access("/tmp/ssh-adSkh4btDHWr/xauthfile",F_OK) ERR#2 'No such file or directory'
>  2506: write(2,"/usr/local/bin/xauth:  file /tmp/ssh-adSkh4btDHWr/xauthfile does not exist\n",75) = 75 (0x4b)

The file didn't exist, it couldn't be read, and it still didn't
exist. Then log a complaint. Nothing ever tried to create the
file in question.

>  2506: access("/tmp/kde-guru/xauth-1001-_0",R_OK) = 0 (0x0)
>  2506: open("/tmp/kde-guru/xauth-1001-_0",O_RDONLY,0666) = 4 (0x4)
>  2506: write(2,"/usr/local/bin/xauth: (argv):1:  ",33) = 33 (0x21)

Some KDE-specific file was opened for read...

>  2506: lstat("/tmp/ssh-adSkh4btDHWr/xauthfile-c",{ mode=-rw------- ,inode=24961,size=0,blksize=32768 }) = 0 (0x0)
>  2506: unlink("/tmp/ssh-adSkh4btDHWr/xauthfile-c") = 0 (0x0)
>  2506: lstat("/tmp/ssh-adSkh4btDHWr/xauthfile-l",{ mode=-rw------- ,inode=24961,size=0,blksize=32768 }) = 0 (0x0)
>  2506: unlink("/tmp/ssh-adSkh4btDHWr/xauthfile-l") = 0 (0x0)
>  2505: unlink("/tmp/ssh-adSkh4btDHWr/xauthfile") ERR#2 'No such file or directory'

And after finding the KDE file, the files and links created
earlier are discarded.

If I were to try something, I'd suggest killing KDE, logging in
from the console, and then seeing if you still have the same
problem. (Or looking at xauth's source for what it's doing with
KDE, and when /tmp/ssh-adSkh4btDHWr/xauthfile was supposed to
have been opened with O_CREAT, and why it might not have been.)

More information about the freebsd-questions mailing list