当前位置:   article > 正文

mac-系统升级到MacOS Mojave 10.14.1 后 ssh 登陆不了远程主机_mac升级后登录不了跳板机了是什么情况

mac升级后登录不了跳板机了是什么情况

使用ssh 登陆后,提示如下错误: 

  1. $ ssh -i ./z_key_2010 -p 26 -v z@119.xx.xx.151
  2. OpenSSH_7.8p1, LibreSSL 2.7.3
  3. debug1: Reading configuration data /Users/zyh/.ssh/config
  4. debug1: Reading configuration data /etc/ssh/ssh_config
  5. debug1: /etc/ssh/ssh_config line 48: Applying options for *
  6. debug1: Connecting to 119.xx.xx.151 [119.xx.xx.151] port 26.
  7. debug1: Connection established.
  8. debug1: identity file ./z_key_2010 type -1
  9. debug1: identity file ./z_key_2010-cert type -1
  10. debug1: Local version string SSH-2.0-OpenSSH_7.8
  11. debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
  12. debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
  13. debug1: Authenticating to 119.xx.xx.151:26 as 'zyh'
  14. debug1: SSH2_MSG_KEXINIT sent
  15. debug1: SSH2_MSG_KEXINIT received
  16. debug1: kex: algorithm: curve25519-sha256
  17. debug1: kex: host key algorithm: ecdsa-sha2-nistp256
  18. debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
  19. debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
  20. debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  21. debug1: Server host key: ecdsa-sha2-nistp256 SHA256:iejlGNnK3SkrDLu+OU1Z4U3tA3Q87yLU
  22. debug1: Host '[119.xx.xx.151]:26' is known and matches the ECDSA host key.
  23. debug1: Found key in /Users/z/.ssh/known_hosts:11
  24. debug1: rekey after 134217728 blocks
  25. debug1: SSH2_MSG_NEWKEYS sent
  26. debug1: expecting SSH2_MSG_NEWKEYS
  27. debug1: SSH2_MSG_NEWKEYS received
  28. debug1: rekey after 134217728 blocks
  29. debug1: Skipping ssh-dss key ./z_key_2010 - not in PubkeyAcceptedKeyTypes
  30. debug1: SSH2_MSG_EXT_INFO received
  31. debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
  32. debug1: SSH2_MSG_SERVICE_ACCEPT received
  33. debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
  34. debug1: Next authentication method: publickey
  35. debug1: Trying private key: ./z_key_2010
  36. Enter passphrase for key './z_key_2010':
  37. sign_and_send_pubkey: no mutual signature supported
  38. debug1: No more authentication methods to try.
  39. z@119.xx.xx.151: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

主要错误为:sign_and_send_pubkey: no mutual signature supported

原因:

MacOS升级10.14.1 后,SSH版本OpenSSH_7.9p1,不再支持dsa算法。使用iterm2远程免密登录跳板机(堡垒机)失败。 提示不支持相互签名。 

解决方法:
新的OpenSSH版本(7.0+)不推荐使用DSA密钥,默认情况下不使用DSA密钥(不在服务器或客户端上)。这些密钥不再被使用,因此如果可以,我建议尽可能使用RSA密钥。
如果确实需要使用DSA密钥,则需要在客户端配置中使用
PubKeyAcceptedKeyTypes+ssh-dss
应该将该行放入~/.ssh/config中

  1. $ cat .ssh/config
  2. Host *
  3. PubkeyAcceptedKeyTypes=+ssh-dss

然后修改config的权限为600

chmode 600 ~/.ssh/config

再次登陆,已经成功了:

  1. $ ssh -i .keys/2010/z_key_2010 -p 26 zyh@119.xx.xx.151
  2. Last login: Thu Apr 18 09:14:45 2019 from 58.xx.xx.12

参考:

https://www.sunjs.com/article/detail/4e7d634c87d440d5913bb12b859b9505.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/536883
推荐阅读
相关标签
  

闽ICP备14008679号