Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After update Mac OS Sierra, Can not use ssh login remote system,how can I fix this?

Tags:

when I use user@ip to login remote system, it report like this:

debug1: /etc/ssh/ssh_config line 17: Applying options for * /etc/ssh/ssh_config: line 20: Bad configuration option: gssapikeyexchange /etc/ssh/ssh_config: line 21: Bad configuration option: gssapitrustdns /etc/ssh/ssh_config: terminating, 2 bad configuration options 
like image 696
Rao Lanffy Avatar asked Sep 22 '16 08:09

Rao Lanffy


People also ask

How do I enable SSH on Mac?

There are two other ways you can enable SSH for macOS devices: Turn on SSH in the GUI by going to System Preferences > Sharing > Remote Login. Leverage the Commands tab in the JumpCloud Directory Platform to enable SSH across your fleet.

How do I remotely connect to a Mac Terminal?

In the Terminal app on your Mac, choose Shell > New Remote Connection. Select a protocol in the Service list. Select a shared server in the Server list. In the User field, enter a user name, then click Connect.

Can't connect to PC from Mac?

If you can't connect Mac and Windows computers, make sure both computers are on the same network and the network connection is working. Here are some additional things to try. Make sure your Mac is connected to the network. To check your connection, choose Apple menu > System Preferences, then click Network .


2 Answers

Comment the following lines in /etc/ssh/ssh_config from

# System-wide defaults set by MIT Kerberos Extras Host *   GSSAPIAuthentication yes   GSSAPIDelegateCredentials yes   GSSAPIKeyExchange yes 

to

# System-wide defaults set by MIT Kerberos Extras #Host * #  GSSAPIAuthentication yes #  GSSAPIDelegateCredentials yes #  GSSAPIKeyExchange yes 
like image 117
hendrasaputra Avatar answered Sep 21 '22 15:09

hendrasaputra


One way to solve this question is copy a ssh binary from an older Mac and place this binary in path before /usr/bin/ssh, ex: (copy from el capitan box) /usr/bin/ssh => ~/bin/ssh, then add $HOME/bin to your PATH before anything else.

The reason is GSSAPITrustDNS and GSSAPIKeyExchange patches are no longer applied by apple, Starting with Sierra when they upgraded OpenSSH to 7.2p2, So one options is to downgrade to the old OS version, if you have to use kerberos+ ssh.

like image 44
sec wang Avatar answered Sep 22 '22 15:09

sec wang