2

I try to make a ssh connection from MacOS to linux. I've tried to follow several tips found on the internet, however I still get the following error when I tried to run xclock:

X11 connection rejected because of wrong authentication. Error: Can't open display: localhost:10.0

A little bit more information:

  • It does not make any difference if I use ssh -X something@somewhere or ssh -Y something@somewhere
  • I did install XQuartz and it is running on my Mac. xclock etc do work on Mac.
  • When I add -vv when logging in I get the following: "debug1: No xauth program. Warning: No xauth data; using fake authentication data for X11 forwarding. debug1: Requesting X11 forwarding with authentication spoofing."
  • which xauth @ Mac gives the result /opt/X11/bin/xauth while which xauth logged in at the server gives /usr/bin/xauth --> Do note that at ssh_config and sshd_config (@Mac) the line XAuthLocation /opt/X11/bin/xauth is present
  • I uncommented ForwardX11 yes and ForwardAgent yes in ssh_config @Mac

If you will need any more information, please let me know! I really hope somebody could guide me to the right solution!

janema
  • 33
  • 1
  • 7
  • Try adding `XAuthLocation /opt/X11/bin/xauth` to your `~/.ssh/config` under the stanza for the Linux host – Mark Setchell Mar 22 '20 at 17:38
  • With ~/.ssh/config do you mean the ssh_config file? Place that line just below 'Host*'? – janema Mar 22 '20 at 17:49
  • No, I mean add the following like this to the top of your `~/.ssh/config` file... `Host *` then 2nd line... `XAuthLocation /opt/X11/bin/xauth` – Mark Setchell Mar 22 '20 at 17:59
  • I am sorry, I am a little bit confused about which file is the ~/.ssh/config file. If I get into the folder ~/.ssh/ I see the files 'ssh_config' and 'sshd_config'. – janema Mar 22 '20 at 18:09
  • The file `~/.ssh/config` is `~/.ssh/config` There certainly should not be a `sshd_config` in that directory because that's the config file for the system-wide daemon which certainly should not be in your HOME directory. – Mark Setchell Mar 22 '20 at 18:32
  • I added the file exactly how you suggested. However, the output of *which xauth* @ linux does not change. It still gives /usr/bin/xauth instead of /opt/X11/bin/xauth. – janema Mar 23 '20 at 15:16
  • In addition to the above, I have `ForwardX11Trusted yes` in my `~/.ssh/config` – Mark Setchell Mar 23 '20 at 15:49
  • It will still give me the same error. Do I have to restart the ssh on the linux perhaps? I honestly cannot do that since I don't have the permission. – janema Mar 23 '20 at 16:07
  • Turned out the memory I was allowed to use was full, that's what caused the problems! Thanks for your help @MarkSetchell – janema Mar 24 '20 at 08:49
  • Cool - glad we got there in the end :-) – Mark Setchell Mar 24 '20 at 10:51

0 Answers0