在.ssh/config(或者/etc/ssh/ssh_config)中配置:
Host xxxxx HostName xxxx User xxxx Port 2222 IdentityFile ~/.ssh/id_rsa StrictHostKeyChecking no UserKnownHostsFile /dev/null
Mac 连接ssh 需要配置下面的信息
原文:https://www.cnblogs.com/securitybob/p/14866389.html