1

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
  • Do you have X11 installed on your MacOS system? – larsks Nov 17 at 4:11
  • How to check it? I have this $ which xauth /opt/X11/bin/xauth – user1424739 Nov 17 at 4:18
  • Is that on the server? – larsks Nov 17 at 4:20
  • Yes. It is on the server. – user1424739 Nov 17 at 4:21
  • 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! – larsks Nov 17 at 4:22
1

Add /opt/X11/bin to your PATH in ~/.bashrc, e.g.

case $PATH in
    (*"/opt/X11/bin"*) ;;
    (*) PATH=$PATH:/opt/X11/bin ;;
esac

at the very start of the file.

(Strictly one ought to look for "/opt/X11/bin:"*|*":/opt/X11/bin:"*|*":/opt/X11/bin"|"/opt/X11/bin" but *"/opt/X11/bin"* is almost certainly good enough)

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.