I'm trying to ssh into a remote server using the format:

user@ip -i ~/.ssh/path/to/key 

and I get the following error:

/etc/ssh/ssh_config: line 55: Bad configuration option: gssapikeyexchange
/etc/ssh/ssh_config: line 56: Bad configuration option: gssapitrustdns
/etc/ssh/ssh_config: terminating, 2 bad configuration options

Connecting to a server without an SSH key doesn't work either.


  • What do the relevant lines look like in your ssh_config?
    – dr.nixon
    Commented Oct 1, 2016 at 13:01
  • @dr.nixon GSSAPIKeyExchange no GSSAPITrustDNS no
    – Verpz
    Commented Oct 1, 2016 at 13:12
  • See stackoverflow.com/a/46454141/32453 if you want an option that works with gssapitrustdns still enabled :)
    – rogerdpack
    Commented Dec 27, 2017 at 17:02

2 Answers 2


Comment out or remove the lines

gssapikeyexchange no
gssapitrustdns no

from your /etc/ssh/ssh_config and you should be good.

  • 1
    What are the consequences?
    – bot47
    Commented Oct 8, 2016 at 7:32
  • Since the new version does not support these options, the only consequence is that it will start to work. Otherwise you will not be able to @MaxRied use kerberos key exchange, which the OP was most probably not using.
    – Jakuje
    Commented Oct 8, 2016 at 7:58

If you need to use Kerberos (and hence the gssapi* options) a viable option is to copy an ssh executable from an older Mac (any version <= OpenSSH_6.7) should work.

cp my-older-ssh /usr/local/bin/ssh

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .