Note that some incomplete answers might lead to security flaws.
- Using ssh -Y means here having fake xauth information which is bad!
- ssh -X should work since XQuartz, once enabled, uses xauth. The only problem is that ssh is looking for xauth in
/usr/X11R6/bin
and on macOS with XQuartz it is in /opt/X11/bin
Secure solution:
-
Enable the first option in the Security tab of preferences (Cmd-,) which enables authenticated connections.
-
Edit
~/.ssh/config
, addXAuthLocation /opt/X11/bin/xauth
to the host config. -
ssh -X your_server
works in a secure manner. -
Ensure xauth is installed on the destination host.