I installed the latest version of XQuartz and:
- changed
# X11Forwarding no
toX11Forwarding yes
in/private/etc/ssh/sshd_config
- enabled Allow connections from network clients in XQuartz
When I try to connect to another server via ssh -X /Users/username/.ssh/id_ed25519 username@host
in xterm, I get the following error:
ssh: Could not resolve hostname /users/username/.ssh/id_ed25519: nodename nor servname provided, or not known
I ran ssh -X remote.Unix.system xclock
and the clock was shown, yet I still got the error. How can I fix this?
System:
- MacBook Pro 2018
- macOS Big Sur 11.5.1
Best Answer
If you wish to specify the private key to use, you need to provide the
-i
option:Otherwise
ssh
will interpret the path to your private key as the name of the server you are trying to connect to, and will fail with the error messagenodename nor servname provided, or not known
.