SSH学习3_ssh 连接报错:debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

本文解决SSH在Putty中工作但在终端上不起作用的问题。通过编辑Ubuntu 13.10/12.10中的/etc/ssh/ssh_config文件,并启用特定设置来确保SSH连接正常运行。

The solution was found here: SSH works in putty but not terminal

in Ubuntu 13.10/12.10, login and gain sudo access.

Edit /etc/ssh/ssh_config, uncomment the following lines

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160

Add the following line

HostKeyAlgorithms ssh-rsa,ssh-dss

You should end up with your /etc/ssh/ssh_config file looking like this

Host *
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
HostKeyAlgorithms ssh-rsa,ssh-dss

Now run ssh -T -v git@github.com and it will ask you to add the server to your known hosts file. Hit yes, and then it should welcome you to the server.

转自:http://www.voidcn.com/article/p-kmgjazmm-bke.html

GJCKGD09064:~ 10280281$ ssh -Tv git@gitlab.com OpenSSH_9.9p1, LibreSSL 3.3.6 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Reading configuration data /etc/ssh/ssh_config.d/100-macos.conf debug1: /etc/ssh/ssh_config.d/100-macos.conf line 1: Applying options for * debug1: Reading configuration data /etc/ssh/crypto.conf debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: Connecting to gitlab.com port 22. debug1: Connection established. debug1: identity file /Users/10280281/.ssh/id_rsa type -1 debug1: identity file /Users/10280281/.ssh/id_rsa-cert type -1 debug1: identity file /Users/10280281/.ssh/id_ecdsa type -1 debug1: identity file /Users/10280281/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/10280281/.ssh/id_ecdsa_sk type -1 debug1: identity file /Users/10280281/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /Users/10280281/.ssh/id_ed25519 type 3 debug1: identity file /Users/10280281/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/10280281/.ssh/id_ed25519_sk type -1 debug1: identity file /Users/10280281/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /Users/10280281/.ssh/id_xmss type -1 debug1: identity file /Users/10280281/.ssh/id_xmss-cert type -1 debug1: identity file /Users/10280281/.ssh/id_dsa type -1 debug1: identity file /Users/10280281/.ssh/id_dsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_9.9 debug1: Remote protocol version 2.0, remote software version GitLab-SSHD debug1: compat_banner: no match: GitLab-SSHD debug1: Authenticating to gitlab.com:22 as &#39;git&#39; debug1: load_hostkeys: fopen /Users/10280281/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: ecdh-sha2-nistp256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: aes128-gcm@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: aes128-gcm@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8 debug1: load_hostkeys: fopen /Users/10280281/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host &#39;gitlab.com&#39; is known and matches the ED25519 host key. debug1: Found key in /Users/10280281/.ssh/known_hosts:2 debug1: ssh_packet_send2_wrapped: resetting send seqnr 3 debug1: rekey out after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: ssh_packet_read_poll2: resetting read seqnr 3 debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 4294967296 blocks debug1: SSH2_MSG_EXT_INFO received debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,ssh-rsa,ssh-dss> debug1: kex_ext_info_check_ver: ping@openssh.com=<0> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: get_agent_identities: bound agent to hostkey debug1: get_agent_identities: agent returned 1 keys debug1: Will attempt key: /Users/10280281/.ssh/id_ed25519 ED25519 SHA256:SuAWMQGFny0Fbbb0v4XrQfli2ahKRO7GFDPQ+kRiSUU agent debug1: Will attempt key: /Users/10280281/.ssh/id_rsa debug1: Will attempt key: /Users/10280281/.ssh/id_ecdsa debug1: Will attempt key: /Users/10280281/.ssh/id_ecdsa_sk debug1: Will attempt key: /Users/10280281/.ssh/id_ed25519_sk debug1: Will attempt key: /Users/10280281/.ssh/id_xmss debug1: Will attempt key: /Users/10280281/.ssh/id_dsa debug1: Offering public key: /Users/10280281/.ssh/id_ed25519 ED25519 SHA256:SuAWMQGFny0Fbbb0v4XrQfli2ahKRO7GFDPQ+kRiSUU agent debug1: Authentications that can continue: publickey debug1: Trying private key: /Users/10280281/.ssh/id_rsa debug1: Trying private key: /Users/10280281/.ssh/id_ecdsa debug1: Trying private key: /Users/10280281/.ssh/id_ecdsa_sk debug1: Trying private key: /Users/10280281/.ssh/id_ed25519_sk debug1: Trying private key: /Users/10280281/.ssh/id_xmss debug1: Trying private key: /Users/10280281/.ssh/id_dsa debug1: No more authentication methods to try. git@gitlab.com: Permission denied (publickey).
最新发布
08-14
xyc@xyc-virtual-machine:~$ ssh -Tv -p 29418 xiayuchen@gerrit-ce.tp-link.com OpenSSH_7.6p1 Ubuntu-4ubuntu0.7, OpenSSL 1.0.2n 7 Dec 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to gerrit-ce.tp-link.com [10.176.69.107] port 29418. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_rsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/xyc/.ssh/id_ed25519-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.7 debug1: Remote protocol version 2.0, remote software version GerritCodeReview_3.3.3 (APACHE-SSHD-2.4.0) debug1: no match: GerritCodeReview_3.3.3 (APACHE-SSHD-2.4.0) debug1: Authenticating to gerrit-ce.tp-link.com:29418 as &#39;xiayuchen&#39; debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: ecdh-sha2-nistp256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:94zokm8g9MOxm56wKUpvlohudHHs+WfWn+YsZ1pWeDM debug1: Host &#39;[gerrit-ce.tp-link.com]:29418&#39; is known and matches the ECDSA host key. debug1: Found key in /home/xyc/.ssh/known_hosts:1 debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/xyc/.ssh/id_rsa debug1: Trying private key: /home/xyc/.ssh/id_dsa debug1: Trying private key: /home/xyc/.ssh/id_ecdsa debug1: Trying private key: /home/xyc/.ssh/id_ed25519 debug1: No more authentication methods to try. xiayuchen@gerrit-ce.tp-link.com: Permission denied (publickey). |这是什么问题
08-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值