No xauth program; cannot forward X11

9,849

Solution 1

Both your client and the server are complaining that they can't find the xauth program. The "debug1: No xauth program" message comes from your client, saying it can't find a copy of xauth locally. The "Remote: No xauth program; cannot forward X11" message is from the server, saying it can't find xauth either. The default location for both client and server is /usr/X11R6/bin/xauth, though your vendor could change it.

For the client, you can set the Xauth location in your .ssh/config:

XAuthLocation /some/path/to/xauth

For the server, you must set the location in the remote server's sshd_config:

XAuthLocation /opt/X11/bin/xauth

After modifying the config, you should run sshd -t to validate the config, then restart sshd to make it reread the file.

Solution 2

I had to install xauth using dnf:

dnf install xauth

Then everything started working as expected. For older Redhat systems use 'yum' instead of 'dnf' in the command above.

Share:
9,849
user1424739
Author by

user1424739

Updated on September 18, 2022

Comments

  • user1424739
    user1424739 over 1 year

    I got the following error message when I use ssh -v -Y. The server OS is mojave. Does anybody know what is wrong?

    debug1: No xauth program.
    Warning: No xauth data; using fake authentication data for X11 forwarding.
    debug1: Requesting X11 forwarding with authentication spoofing.
    debug1: Sending environment.
    debug1: Sending env LANG = en_US.UTF-8
    debug1: Remote: No xauth program; cannot forward X11.
    X11 forwarding request failed on channel 0
    
    • larsks
      larsks over 4 years
      Do you have X11 installed on your MacOS system?
    • user1424739
      user1424739 over 4 years
      How to check it? I have this $ which xauth /opt/X11/bin/xauth
    • larsks
      larsks over 4 years
      Is that on the server?
    • user1424739
      user1424739 over 4 years
      Yes. It is on the server.
    • larsks
      larsks over 4 years
      In that case, I'm not sure why you're getting that error. I don't have a MacOS system on which I can check. Hopefully someone else will help out!